rem 修改环境变量
wmic ENVIRONMENT where "name='ndroppath' "
rem undo
if %1 == "u" goto undo
wmic ENVIRONMENT where "name='ndroppath' and username='<SYSTEM>'" set VariableValue='\\build01\temp\limi\Cache'
goto next
:undo
wmic ENVIRONMENT where "name='ndroppath' and username='<SYSTEM>'" set VariableValue='\\nu\Nu\Share\Drops\CI\dev\packages'
:next
wmic ENVIRONMENT where "name='ndroppath' "
rem copy bookmark
xcopy shj0829 shj /T
rem /E 包含空文件夹
rem open url
"C:\Program Files\Internet Explorer\iexplore.exe" http://a.co
rem open task manager
start %systemroot%\system32\taskmgr.exe /1
rem vbs eg
Set obj = CreateObject("System.Collections.ArrayList")
obj.Add("this is a test")
obj.Add(1)
obj.Add(obj)
Msgbox obj(0)
Msgbox obj(1)
Msgbox obj(2).ToString()
rem debug vbs
wscript.exe /x %1
echo some path
@echo off
echo 当前盘符:%~d0
echo 当前盘符和路径:%~dp0
echo 当前批处理全路径:%~f0
echo 当前盘符和路径的短文件名格式:%~sdp0
echo 当前CMD默认目录:%cd%
echo 目录中有空格也可以加入""避免找不到路径
echo 当前盘符:"%~d0"
echo 当前盘符和路径:"%~dp0"
echo 当前批处理全路径:"%~f0"
echo 当前盘符和路径的短文件名格式:"%~sdp0"
echo 当前CMD默认目录:"%cd%"
pause
原文地址:http://blog.51cto.com/10458137/2115335