本地命令的CMD语法

时间:2014-07-03 09:56:04

标签: cmd rundll32

我想运行一个脚本,复制我的文件夹并在我复制的文件夹中启动rundll32。

mkdir "c:\SmartCard_Treiber"
xcopy "%~DP0SmartCard_Treiber\*" "c:\SmartCard_Treiber" /i /s


cmd /c cd "c:\SmartCard_Treiber" & RUNDLL32.EXE AdvPack.dll,LaunchINFSection Gemalto.inf,,0


TIMEOUT /T 30 /NOBREAK 
rd "C:\SmartCard_Treiber" /Q /S

1 个答案:

答案 0 :(得分:2)

mkdir "c:\SmartCard_Treiber"
xcopy "%~DP0SmartCard_Treiber\*" "c:\SmartCard_Treiber" /i /s
pushd "c:\SmartCard_Treiber"
RUNDLL32.EXE AdvPack.dll,LaunchINFSection Gemalto.inf,,0
TIMEOUT /T 30 /NOBREAK 
popd
rd "C:\SmartCard_Treiber" /Q /S

更改为所需目录(pushd),完成后返回上一个目录(popd