1.

Solve : help needed with writing a batch file?

Answer»

Hello,

I have downloaded the updates that i needed for my Win XP PRO. Now I'm trying to write a batch file to start the install of my updates.
I'm able to start the install with the comand: "start" followed by the location, then i used the "then" comand to go to the next update. Th problem is that I want the next update to start after the one before has finished, and not while the first one is still running.
So Will you guys help me please, on how I have to program it, or if there is a better way to accomplish this.

I'm trying to create something like this so I don't need to download the same updates every time.

Thnx

What "then command"? I have never heard of it before.

Type start /? at the prompt to see all the options and the syntax including the /WAIT switch.
I have used "then" in a comand line as followed:

start c:\windowsXPsp3
then
start c:\sp3secrityupdate

I have used the then comand like i would use it in VB: first this comand an "then" the second comand. But the problem is that the batch file starts the comands directly behind eachother, what makes that my updates will install simultaneous and not one by one.
But now I will try what you propose, and will let you know if it works for me.Wow. I always though that in VB the "then" keyword was used with If tests like this

If A = B then
C
End If

So can you please direct me to some documentation that shows this other use that you appear to know about?

Also, you cannot rely on using VB keywords in batch files and expecting them to work. You cannot do this with keywords from Pascal, Fortran, C++, Perl, Python or Bash either. The /wait switch only works for non-gui applications. I tried it with firefox...And found the sad truth. Quote from: Helpmeh on November 19, 2009, 04:58:27 AM

The /wait switch only works for non-gui applications. I tried it with firefox...And found the sad truth.

I just tried it with regedit, notepad, calc, Winword.exe (MS Office 2003) and... "C:\Program Files\Mozilla Firefox\firefox.exe" ...

You did remember the title string? (trawl the forums and see how often this catches people out)



How come ff works for you and not me?!Quote from: Helpmeh on November 19, 2009, 01:21:45 PM
How come ff works for you and not me?!

pls confirm you are using this format

Code: [Select]start /wait "title" "path\Program"
"title" can be just 2 quotes "" but it can't be omitted

"path\Program" needs quotes if there are any spaces

try this

Code: [Select]start /wait "" calc
Quote from: Salmon Trout on November 19, 2009, 01:45:13 PM
pls confirm you are using this format

Code: [Select]start /wait "title" "path\Program"
"title" can be just 2 quotes "" but it can't be omitted

"path\Program" needs quotes if there are any spaces

try this

Code: [Select]start /wait "" calc



That may be why. I have never used start other than
start PATH\PROGRAM

I also didn't add the path, because just doing

start firefox

works fine. Thanks for the info,

the wait switch did it for me.

I have to say that I was wrong with an earlier comand I wrote down here, because the keyword "then" is in DEAD only used in if tests.
So I'm sorry about that mistake.

Anyway, thanks for the help.There is no THEN command, therefore, you can not use it in IF tests. You are thinking of some other LANGUAGE, VB perhaps?Quote from: Helpmeh on November 23, 2009, 04:07:30 AM
There is no THEN command, therefore, you can not use it in IF tests. You are thinking of some other language, VB perhaps?

Read the previous POSTS; this was established on Nov 19.


Discussion

No Comment Found