Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Object Through Scripting

Status
Not open for further replies.

wreded

Technical User
Dec 18, 2001
119
US
i've got a training show to run and the only i can think of is through a batch file calling 2 separate .VBS files. It appears to run fine ONLY if i pause the batch file.
Batch File looks like this:
Code:
ECHO OFF
Driving1.vbs
Pause
x:
Pause
Start.html
Pause
J:
cd \(original folder goes here)
Driving2.vbs
REM pause

Driving1.vbs looks like this:
Code:
On Error Resume Next
Dim objNet
Set objNet = CreateObject("Wscript.Network")
objNet.MapNetworkDrive "X:", "\\ServerName\Folder1\Folder2"
Driving2.vbs looks like this:
Code:
On Error Resume Next
Dim objNet
Set objNet = CreateObject("wScript.Network")
objNet.RemoveNetworkDrive "X:"

i'm trying to make this as invisible to users as possible so they can obtain their required training with as little effort as possible (and as unbreakable as possible). When i remove the "Pause" statements in the .BAT file i get errors that "Folder2\Data cannot be found". When i leave the "Pause" statements in it works correctly, but leaves the DOS screen visible and prompts to "Press a key...". i've also tried going directly to the .HTML file with VBscript but get the "Folder2\Data cannot be found" error (\Data is where the whole thing is actually run from, the "Start.html" is just the wrapper). It's one of those things that everyone must do and i have no say how it's put together, just get it out the door.

Why would it work with the "Pause" statements in effect and not with them removed?
Thanks,
Dave
 
What about this ?
Code:
ECHO OFF
NET USE X: \\ServerName\Folder1\Folder2
X:
Start.html
J:
cd \(original folder goes here)
NET USE X: /DELETE

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That was actually my first cut. But the network gurus have turned off most USEFUL batch scripting. That's why i had to resort to VBscript. If i just make a VBscript it doesn't work either (i forget the exact error it throws) that's why i came up with this version. It does work, just not as (i think) it should.
Thanks for the input!
Dave
 
Have you tried something like:
Code:
ECHO OFF
start /wait Driving1.vbs
x:
Start.html
J:
cd \(original folder goes here)
start /wait Driving2.vbs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top