Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - doesn't finish

Reply
 
Old 04-09-2009   #1 (permalink)
SAC


 
 

doesn't finish

I have three batch files I use to run some scripts. The second batch a
setup.exe program on a CD for a prepackaged software. After it completes it
doesn't run the third batch file.

Here's the first batch file used to call the 2nd and 3rd:

cscript MakeFile.VBS
cscript MakeODBC.vbs

call 2.bat

call 3.bat

2.bat runs the setup program but it never makes it to the 3rd batch file.

How can I make this happen?

Thanks for your help.







My System SpecsSystem Spec
Old 04-09-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: doesn't finish


"SAC" <someone@xxxxxx> wrote in message
news:uLMIczRuJHA.4068@xxxxxx
Quote:

>I have three batch files I use to run some scripts. The second batch a
>setup.exe program on a CD for a prepackaged software. After it completes
>it doesn't run the third batch file.
>
> Here's the first batch file used to call the 2nd and 3rd:
>
> cscript MakeFile.VBS
> cscript MakeODBC.vbs
>
> call 2.bat
>
> call 3.bat
>
> 2.bat runs the setup program but it never makes it to the 3rd batch file.
>
> How can I make this happen?
>
> Thanks for your help.
This will happen if 2.bat doesn't finish its job. Unfortunately you're not
telling us what's in it. I suspect using the "start" command inside 2.bat
will fix the problem.

Instead of having three batch files, it might be neater to have a single
batch file and use subroutines:

@echo off
cscript //nologo MakeFile.VBS
cscript //nologo MakeODBC.vbs
call :Label2
call :Label3
goto :eof

:Label2
{your code}
goto :eof

:Label3
{your code}
goto :eof


My System SpecsSystem Spec
Old 04-09-2009   #3 (permalink)
SAC


 
 

Re: doesn't finish

I tried you suggestion and I still can't get it to work. This is what I
have:

@echo off
cscript //nologo MakeFile.VBS
cscript //nologo MakeODBC.vbs
call :Label2
call :Label3
goto :eof

:Label2
net use N: \\valawfac01\fmdesktop\install
n:
start /wait N:\Facman~1\Setup.exe 'This is the program that run a setup
program from the cd. If I cancel it, I want to go on to Label3
goto :eof

:Label3
msgbox("3")
cscript CopyVang.vbs
c:
Net Use N: /Delete
goto :eof


Thanks for your help!

"Pegasus [MVP]" <news@xxxxxx> wrote in message
news:OD4FIPSuJHA.1240@xxxxxx
Quote:

>
> "SAC" <someone@xxxxxx> wrote in message
> news:uLMIczRuJHA.4068@xxxxxx
Quote:

>>I have three batch files I use to run some scripts. The second batch a
>>setup.exe program on a CD for a prepackaged software. After it completes
>>it doesn't run the third batch file.
>>
>> Here's the first batch file used to call the 2nd and 3rd:
>>
>> cscript MakeFile.VBS
>> cscript MakeODBC.vbs
>>
>> call 2.bat
>>
>> call 3.bat
>>
>> 2.bat runs the setup program but it never makes it to the 3rd batch file.
>>
>> How can I make this happen?
>>
>> Thanks for your help.
>
> This will happen if 2.bat doesn't finish its job. Unfortunately you're not
> telling us what's in it. I suspect using the "start" command inside 2.bat
> will fix the problem.
>
> Instead of having three batch files, it might be neater to have a single
> batch file and use subroutines:
>
> @echo off
> cscript //nologo MakeFile.VBS
> cscript //nologo MakeODBC.vbs
> call :Label2
> call :Label3
> goto :eof
>
> :Label2
> {your code}
> goto :eof
>
> :Label3
> {your code}
> goto :eof
>
>

My System SpecsSystem Spec
Old 04-09-2009   #4 (permalink)
Pegasus [MVP]


 
 

Re: doesn't finish

You appear to mix VB Script and batch file syntax freely. This won't work.
Since you start your program with the line "@echo off", I assume that this
is a batch file. You now need to turn your attention to the following lines:

=>start /wait N:\Facman~1\Setup.exe 'This is the program . . .
The single quote is used in VB Script files to denote a comment. This won't
work in batch files. Furthermore, if you use the "start" command then the
subroutine under Label2 will end immediately while setup.exe assumes an
independent life of its own. Is this really what you want?

=> n:
What is the purpose of this line? It does no good (but it doesn't do any
harm either).

=> msgbox("3")
msgbox is a VB Script command, not a batch file command.

=> cscript CopyVang.vbs
What are you copying here? A file? If so, why not do it directly from the
batch file?

You probably need to think hard about the best way to tackle this task. As a
general rule it is preferred to have a homogenous environment: Either all VB
Script, or all batch. I try to avoid mixing the two whenever possible. In
your case 50% of the code appears to be batch and 50% VB Script. Is there a
sound reason for this mix?


"SAC" <someone@xxxxxx> wrote in message
news:uuXBphSuJHA.3928@xxxxxx
Quote:

>I tried you suggestion and I still can't get it to work. This is what I
>have:
>
> @echo off
> cscript //nologo MakeFile.VBS
> cscript //nologo MakeODBC.vbs
> call :Label2
> call :Label3
> goto :eof
>
> :Label2
> net use N: \\valawfac01\fmdesktop\install
> n:
> start /wait N:\Facman~1\Setup.exe 'This is the program that run a setup
> program from the cd. If I cancel it, I want to go on to Label3
> goto :eof
>
> :Label3
> msgbox("3")
> cscript CopyVang.vbs
> c:
> Net Use N: /Delete
> goto :eof
>
>
> Thanks for your help!
>
> "Pegasus [MVP]" <news@xxxxxx> wrote in message
> news:OD4FIPSuJHA.1240@xxxxxx
Quote:

>>
>> "SAC" <someone@xxxxxx> wrote in message
>> news:uLMIczRuJHA.4068@xxxxxx
Quote:

>>>I have three batch files I use to run some scripts. The second batch a
>>>setup.exe program on a CD for a prepackaged software. After it completes
>>>it doesn't run the third batch file.
>>>
>>> Here's the first batch file used to call the 2nd and 3rd:
>>>
>>> cscript MakeFile.VBS
>>> cscript MakeODBC.vbs
>>>
>>> call 2.bat
>>>
>>> call 3.bat
>>>
>>> 2.bat runs the setup program but it never makes it to the 3rd batch
>>> file.
>>>
>>> How can I make this happen?
>>>
>>> Thanks for your help.
>>
>> This will happen if 2.bat doesn't finish its job. Unfortunately you're
>> not telling us what's in it. I suspect using the "start" command inside
>> 2.bat will fix the problem.
>>
>> Instead of having three batch files, it might be neater to have a single
>> batch file and use subroutines:
>>
>> @echo off
>> cscript //nologo MakeFile.VBS
>> cscript //nologo MakeODBC.vbs
>> call :Label2
>> call :Label3
>> goto :eof
>>
>> :Label2
>> {your code}
>> goto :eof
>>
>> :Label3
>> {your code}
>> goto :eof
>>
>>
>
>

My System SpecsSystem Spec
Old 04-10-2009   #5 (permalink)
SAC


 
 

Re: doesn't finish

OK, thanks. I'll make that change.

In the mean time, if I only use batch files, how can I make it continue when
the setup.exe program finishes?

Here's a sample of what I have now:

echo "Hi there."
call :Label2
call :Label3
goto :eof

:Label2
net use N: \\valawfac01\fmdesktop\install
n:
start /wait N:\Facman~1\Setup.exe
goto :eof

:Label3
echo "Hi there Label3"
goto :eof

When Label2 finishes, the setup.exe program, it doesn't go to Label3.

I really appreciate your help.


"Pegasus [MVP]" <news@xxxxxx> wrote in message
news:%23UErEqSuJHA.1504@xxxxxx
Quote:

> You appear to mix VB Script and batch file syntax freely. This won't work.
> Since you start your program with the line "@echo off", I assume that this
> is a batch file. You now need to turn your attention to the following
> lines:
>
> =>start /wait N:\Facman~1\Setup.exe 'This is the program . . .
> The single quote is used in VB Script files to denote a comment. This
> won't work in batch files. Furthermore, if you use the "start" command
> then the subroutine under Label2 will end immediately while setup.exe
> assumes an independent life of its own. Is this really what you want?
>
> => n:
> What is the purpose of this line? It does no good (but it doesn't do any
> harm either).
>
> => msgbox("3")
> msgbox is a VB Script command, not a batch file command.
>
> => cscript CopyVang.vbs
> What are you copying here? A file? If so, why not do it directly from the
> batch file?
>
> You probably need to think hard about the best way to tackle this task. As
> a general rule it is preferred to have a homogenous environment: Either
> all VB Script, or all batch. I try to avoid mixing the two whenever
> possible. In your case 50% of the code appears to be batch and 50% VB
> Script. Is there a sound reason for this mix?
>
>
> "SAC" <someone@xxxxxx> wrote in message
> news:uuXBphSuJHA.3928@xxxxxx
Quote:

>>I tried you suggestion and I still can't get it to work. This is what I
>>have:
>>
>> @echo off
>> cscript //nologo MakeFile.VBS
>> cscript //nologo MakeODBC.vbs
>> call :Label2
>> call :Label3
>> goto :eof
>>
>> :Label2
>> net use N: \\valawfac01\fmdesktop\install
>> n:
>> start /wait N:\Facman~1\Setup.exe 'This is the program that run a setup
>> program from the cd. If I cancel it, I want to go on to Label3
>> goto :eof
>>
>> :Label3
>> msgbox("3")
>> cscript CopyVang.vbs
>> c:
>> Net Use N: /Delete
>> goto :eof
>>
>>
>> Thanks for your help!
>>
>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>> news:OD4FIPSuJHA.1240@xxxxxx
Quote:

>>>
>>> "SAC" <someone@xxxxxx> wrote in message
>>> news:uLMIczRuJHA.4068@xxxxxx
>>>>I have three batch files I use to run some scripts. The second batch a
>>>>setup.exe program on a CD for a prepackaged software. After it
>>>>completes it doesn't run the third batch file.
>>>>
>>>> Here's the first batch file used to call the 2nd and 3rd:
>>>>
>>>> cscript MakeFile.VBS
>>>> cscript MakeODBC.vbs
>>>>
>>>> call 2.bat
>>>>
>>>> call 3.bat
>>>>
>>>> 2.bat runs the setup program but it never makes it to the 3rd batch
>>>> file.
>>>>
>>>> How can I make this happen?
>>>>
>>>> Thanks for your help.
>>>
>>> This will happen if 2.bat doesn't finish its job. Unfortunately you're
>>> not telling us what's in it. I suspect using the "start" command inside
>>> 2.bat will fix the problem.
>>>
>>> Instead of having three batch files, it might be neater to have a single
>>> batch file and use subroutines:
>>>
>>> @echo off
>>> cscript //nologo MakeFile.VBS
>>> cscript //nologo MakeODBC.vbs
>>> call :Label2
>>> call :Label3
>>> goto :eof
>>>
>>> :Label2
>>> {your code}
>>> goto :eof
>>>
>>> :Label3
>>> {your code}
>>> goto :eof
>>>
>>>
>>
>>
>
>

My System SpecsSystem Spec
Old 04-10-2009   #6 (permalink)
SAC


 
 

Re: doesn't finish

Thanks for your help. I got it to work!

"Pegasus [MVP]" <news@xxxxxx> wrote in message
news:%23UErEqSuJHA.1504@xxxxxx
Quote:

> You appear to mix VB Script and batch file syntax freely. This won't work.
> Since you start your program with the line "@echo off", I assume that this
> is a batch file. You now need to turn your attention to the following
> lines:
>
> =>start /wait N:\Facman~1\Setup.exe 'This is the program . . .
> The single quote is used in VB Script files to denote a comment. This
> won't work in batch files. Furthermore, if you use the "start" command
> then the subroutine under Label2 will end immediately while setup.exe
> assumes an independent life of its own. Is this really what you want?
>
> => n:
> What is the purpose of this line? It does no good (but it doesn't do any
> harm either).
>
> => msgbox("3")
> msgbox is a VB Script command, not a batch file command.
>
> => cscript CopyVang.vbs
> What are you copying here? A file? If so, why not do it directly from the
> batch file?
>
> You probably need to think hard about the best way to tackle this task. As
> a general rule it is preferred to have a homogenous environment: Either
> all VB Script, or all batch. I try to avoid mixing the two whenever
> possible. In your case 50% of the code appears to be batch and 50% VB
> Script. Is there a sound reason for this mix?
>
>
> "SAC" <someone@xxxxxx> wrote in message
> news:uuXBphSuJHA.3928@xxxxxx
Quote:

>>I tried you suggestion and I still can't get it to work. This is what I
>>have:
>>
>> @echo off
>> cscript //nologo MakeFile.VBS
>> cscript //nologo MakeODBC.vbs
>> call :Label2
>> call :Label3
>> goto :eof
>>
>> :Label2
>> net use N: \\valawfac01\fmdesktop\install
>> n:
>> start /wait N:\Facman~1\Setup.exe 'This is the program that run a setup
>> program from the cd. If I cancel it, I want to go on to Label3
>> goto :eof
>>
>> :Label3
>> msgbox("3")
>> cscript CopyVang.vbs
>> c:
>> Net Use N: /Delete
>> goto :eof
>>
>>
>> Thanks for your help!
>>
>> "Pegasus [MVP]" <news@xxxxxx> wrote in message
>> news:OD4FIPSuJHA.1240@xxxxxx
Quote:

>>>
>>> "SAC" <someone@xxxxxx> wrote in message
>>> news:uLMIczRuJHA.4068@xxxxxx
>>>>I have three batch files I use to run some scripts. The second batch a
>>>>setup.exe program on a CD for a prepackaged software. After it
>>>>completes it doesn't run the third batch file.
>>>>
>>>> Here's the first batch file used to call the 2nd and 3rd:
>>>>
>>>> cscript MakeFile.VBS
>>>> cscript MakeODBC.vbs
>>>>
>>>> call 2.bat
>>>>
>>>> call 3.bat
>>>>
>>>> 2.bat runs the setup program but it never makes it to the 3rd batch
>>>> file.
>>>>
>>>> How can I make this happen?
>>>>
>>>> Thanks for your help.
>>>
>>> This will happen if 2.bat doesn't finish its job. Unfortunately you're
>>> not telling us what's in it. I suspect using the "start" command inside
>>> 2.bat will fix the problem.
>>>
>>> Instead of having three batch files, it might be neater to have a single
>>> batch file and use subroutines:
>>>
>>> @echo off
>>> cscript //nologo MakeFile.VBS
>>> cscript //nologo MakeODBC.vbs
>>> call :Label2
>>> call :Label3
>>> goto :eof
>>>
>>> :Label2
>>> {your code}
>>> goto :eof
>>>
>>> :Label3
>>> {your code}
>>> goto :eof
>>>
>>>
>>
>>
>
>

My System SpecsSystem Spec
Old 04-10-2009   #7 (permalink)
Pegasus [MVP]


 
 

Re: doesn't finish

Turn on debugging as shown in the batch file below, then do this:
- Click Start, then Run
- Type the three letters cmd
- Click the OK button
- Navigate to the folder where your batch file resides
- Type its name and press the Enter key
- Report what happens.

@echo on
echo "Hi there."
call :Label2
call :Label3
goto :eof

:Label2
net use N: \\valawfac01\fmdesktop\install
n:
N:\Facman~1\Setup.exe
goto :eof

:Label3
echo "Hi there Label3"
goto :eof

"SAC" <someone@xxxxxx> wrote in message
news:O0sYn0duJHA.1240@xxxxxx
Quote:

> OK, thanks. I'll make that change.
>
> In the mean time, if I only use batch files, how can I make it continue
> when the setup.exe program finishes?
>
> Here's a sample of what I have now:
>
> echo "Hi there."
> call :Label2
> call :Label3
> goto :eof
>
> :Label2
> net use N: \\valawfac01\fmdesktop\install
> n:
> start /wait N:\Facman~1\Setup.exe
> goto :eof
>
> :Label3
> echo "Hi there Label3"
> goto :eof
>
> When Label2 finishes, the setup.exe program, it doesn't go to Label3.
>
> I really appreciate your help.
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
finish Vista mail
W E I won't finish.... Vista performance & maintenance
W E I won't finish... Vista performance & maintenance
How to finish downloading RC1 - try 3 Vista account administration
How to finish downloading RC1 Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46