windows 批处理后台运行

在你批处理的相同目录下新建一个记事本,里面输入:
set ws=wscript.createobject("wscript.shell")
ws.run "win.bat /start",0
(其中win.bat为你自己的批处理名字,自己改)

然后把这个记事本保存为后缀名为.vbs的文件,到时候你只要运行这个vbs文件就达到目的了!


or


dim objShell
set objShell=wscript.createObject("WScript.Shell")
iReturnCode=objShell.Run("ssh.bat",0,TRUE)



vbs命令行参数:

Set oArgs = WScript.Arguments
     For Each s In oArgs
         MsgBox(s)
     Next
Set oArgs = Nothing


Dim szBuf, i
i = 0
For Each Arg In WScript.Arguments
          i = i + 1
        szBuf = szBuf & "参数" & i & vbTab & Arg & vbCrLf
Next
MsgBox szBuf, vbInformation, WScript.Arguments.Count


远程启动emacs:

dim objShell
set objShell=wscript.createObject("WScript.Shell")
iReturnCode=objShell.Run("plink -ssh -2 -X -pw gxp [email protected] emacsclient -c",0,TRUE)



你可能感兴趣的:(windows 批处理后台运行)