
CODE: [Copy to clipboard]批处理总是会弹个黑框很不爽,希望高手能帮我把这段批处理转变成VBS的!谢@echo off
for %%a in (c d e f g h i) do (
if exist %%a:\nul 2>nul (
for /f "tokens=*" %%b in ('dir /s/b/a %%a:\amped.exe') do echo %%~dpb>C:\1.txt
))
::del %0
CODE: [Copy to clipboard]sFile = "c:\1.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(sFile,2,True)
sWQL = "Select * From CIM_DataFile Where " & _
"FileName = 'amped' And Extension = 'exe'"
For Each itemFile In GetObject("Winmgmts:").ExecQuery(sWQL)
oFile.WriteLine itemFile.name
Next
oFile.Close
MsgBox "执行完毕!"
| Quote: | |
|
CODE: [Copy to clipboard]sFile = "c:\1.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile(sFile,2,True)
sWQL = "Select * From CIM_DataFile Where " & _
"FileName = 'amped' And Extension = 'exe'"
For Each itemFile In GetObject("Winmgmts:").ExecQuery(sWQL)
oFile.WriteLine itemFile.Drive & itemFile.Path
Next
oFile.Close
MsgBox "执行完毕!"
| Quote: | |
|
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |