China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 05:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Problems with VBS scripts that call programs without pop-up windows View 1,558 Replies 4
Original Poster Posted 2007-04-19 11:15 ·  中国 江苏 苏州 电信
中级用户
★★
Credits 201
Posts 69
Joined 2005-12-07 17:35
20-year member
UID 46678
Gender Male
Status Offline
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!
Floor 2 Posted 2007-04-19 12:15 ·  中国 广东 广州 番禺区 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
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.
知,不觉多。不知,乃求知
Floor 3 Posted 2007-04-19 12:41 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
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)
Floor 4 Posted 2007-04-19 13:17 ·  中国 江苏 苏州 电信
中级用户
★★
Credits 201
Posts 69
Joined 2005-12-07 17:35
20-year member
UID 46678
Gender Male
Status Offline
Still not working. Does it work on your machine?
Floor 5 Posted 2007-04-19 23:07 ·  中国 上海 浦东新区 电信
中级用户
★★
Credits 302
Posts 138
Joined 2007-03-29 02:33
19-year member
UID 83224
Gender Male
Status Offline
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.
Forum Jump: