我试图在 MS 窗口 xp 中从 cmd 脚本转到 vbscript
cmd代码是的
set home_=%~dp0
set part001=part001
set part002=part002
set part003=part003
set part004=part004
::get the dir in part001
for /f "delims=" %%A in ('dir /s/b/o:n/a:d ^"%home%%part001%\^"') do (
echo show have dir path
echo %%A
pause
)
echo to the end
pause
goto :eof
到 vbscript
我不知道要转换的部分是那些被格式化为cmd{cmd 编码}
dim strHome as strimg =cmd{[%~dp0]}
dim strPart001 as sting = part001
dim strPart002 as sting = part002
dim strPart003 as sting = part003
dim strPart004 as sting = part004
'get the dir in part001
Dim objFSo, objFile
Set objFSo = CreateObject("Scripting.FileSystemObject")
set objDirPart001list = objFS.getfolder(strHome&strPart001\)
set subDirPart001list = objDirPart001list.SubFolders
for each subDirPart001Name in subDirPart001list
WScript.Echo show dir path
WScript.Echo part
cmd{pause}
)
cmd{pause}
对应的 vbscript 命令是什么:
- %~dp0
- 暂停