怎样使用vbe文件打开cmd并在cmd里运行命令?
高手进!!
谢了
怎样使用vbe文件打开cmd并在cmd里运行命令?
高手进!!
谢了
dim obj
set obj=createobject("wscript.shell")
obj.run "command /c dir c:\*.* >>c.txt"
obj.run "command /c dir d:\*.* >>d.txt"
set obj=nothing
obj.run "command /c dir c:\*.* >>c.txt",0
给你举几个个例子吧:
1.显示“windows命令行”
CreateObject("wscript.shell").Run "cmd /c @echo off&echo windows命令行!&echo.&pause"
2.显示“windows命令行”
Set ws=CreateObject("wscript.shell") ws.Run "cmd /c @echo off&echo windows命令行!&echo.&pause"
3.执行倒计时关机(2000秒)
Set Ws=createobject("wscript.shell") Ws. exec "shutdown -s -t 2000"
3.显示“QQ运行路径”,前提是你开着QQ
SET Ws=createobject("wscript.shell") Ws.run "cmd /c wmic process where name=""QQ.exe"" get ExecutablePath&pause"