Advertisement

06.06.2008 at 07:12AM PDT, ID: 23463749 | Points: 250
[x]
Attachment Details

wscript into directories

Asked by SamsonChung in Windows Batch Scripting

Hi guys,

I've been working on something that is pushing my programming limitations a bit. VBscripting :p

I simply want to do the following

Z:\program\subprogram1\setupthis.vbs, Z:\program\subprg2\setup this.vbs
Z:\program\setup ME.vbs

I want setup ME.vbs to call each of the subprogram's setup.vbs in order.
So I got the following,

SET fso = CreateObject("Scripting.FileSystemObject")
curDir = fso.GetParentFolderName(WScript.ScriptFullName)

SET WshShell = CreateObject("WScript.Shell")

cmdLine = "cscript """ & curDir & "\subprogram1\setupthis.vbs"" "
wshell.Run cmdLine, 1, true

I repeat that for the 2nd vbs file.

The problem is, when I run it, Windows keep on telling me it can't find the file, while the file is literally staring at me to my face.

i've tried it via cmd, with cscript ./subprogram1\setupthis.vbs
that doesn't work either...

Did I do something stupid in this code??Start Free Trial
[+][-]06.06.2008 at 08:20AM PDT, ID: 21729893

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 08:23AM PDT, ID: 21729927

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 08:33AM PDT, ID: 21730022

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 08:45AM PDT, ID: 21730120

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 08:52AM PDT, ID: 21730207

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.09.2008 at 06:36AM PDT, ID: 21743017

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628