中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-04 06:48
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Problems with VBS scripts that call programs without pop-up windows
Printable Version  1,561 / 4
Floor1 sjs0512 Posted 2007-04-19 11:15
中级用户 Posts 69 Credits 201
dim objshell
set objshell=wscript.createobject("wscript.shell")
wscript.sleep(10000)
iReturn=objshell.Run("cmd.exe/c \\127.0.0.1\e:\1.bat",0,true)
There is no pop-up window to call the e:\1.bat file. But there is always a problem with my VBS script. Where is the problem? Urgent!
Floor2 flyinspace Posted 2007-04-19 12:15
银牌会员 Posts 517 Credits 1,206
I don't understand VBS... But it seems yours doesn't meet the requirements.

set objshell=wscript.createobject("wscript.shell")
wscript.sleep(1000)
iReturn=objshell.Run("cmd.exe",1,true)
This seems okay...

DIM seems to have a requirement of being in uppercase.
Floor3 zh159 Posted 2007-04-19 12:41
金牌会员 Posts 1,467 Credits 3,687
There seems to be no distinction between uppercase and lowercase in VBS.

There is an error in the parameters of running cmd. There must be a space between /c and cmd. Modify:
iReturn=objshell.Run("cmd.exe /c \\127.0.0.1\e:\1.bat",0,true)
Floor4 sjs0512 Posted 2007-04-19 13:17
中级用户 Posts 69 Credits 201
Still not working. Does it work on your machine?
Floor5 lililulula Posted 2007-04-19 23:07
中级用户 Posts 138 Credits 302
set objshell=wscript.createobject("wscript.shell")
objshell.run "path:\batfilename",0


iReturn=objshell.Run("cmd.exe/c \\127.0.0.1\e:\1.bat",0,true)

For programs on a remote machine, the owner can first map the remote directory to a local drive letter and then perform the call.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023