Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
It's been a long time since I did much batch file writing and forgot how to test a batch file a line at a time.
I know there was a switch or something that causes the batch file to execute one line at lime for debugging purposes.Any help would be appreciated. Thanks!
Thanks for the welcome and the suggestions!
... I'm going to work on it a bit more and try to sort it out.
Thanks for the welcome and the suggestions!As a matter of fact, it was Dos 6.22 & Win 3.11 on my first IBM compatible and it was there that I did quite a bit of batch file programming. Now, most of my work is on WinXP, but I have Vista on a new laptop, and have discovered some differences already in the way batch files work in Vista than XP. (The first being the problem with Xcopy failing to copy when ProgramFiles is the destination. That of course is because Vista protects ProgramFiles just like the good watch dog that it is.)As to my trip down memory lane, I don't remember the command /y. I think I remembered something more like mybatch.bat /# where the pound is a charactor that I can't remember. But since I can't remember the charactor, it may be just a figment of my imagination. I hope to find my old DOS book which is filled with notes. I had an instructor that taught us quite a few undocumented tricks. Maybe it was one of them. If I find anything, I'll let you know.I tried to get the command /y mybatch.bat to work one time and got some weird results.(several command windows opened up at once and I didn't have time to figure it out.) I was able to get the batch file to work(in XP) by using a pause repeatedly, starting near the beginning and moving it down one step at a time till I figured it out. But, when I tested it on Vista I discovered that Vista seems to treat the start command differently than XP when using a batchfile to execute a program. (I can't see the difference in the start /? results) I'm going to work on it a bit more and try to sort it out.Thanks again.
i would suggest you move on to more advanced programming language ( including vbscript) to do what you want. Its time to move on.
I haven't been able to crack my problem in the Batch file in Vista. The following few lines illustrate what I'm trying to do.Code: [Select]@ECHO OFF"E:\My Program 1\My Program 1.LNK"CLSECHO.ECHO My Message. Do this first.ECHO Now press a key to run Program 2.ECHO.Pause > NUL"E:\My Program 2\My Program 2.LNK"In XP, "My Program 1" opens, the batchfile continues, ECHO's the message, and stops at the pause. After I press a key, "My Program 2" opens and the batchfile continues.In Vista, "My Program 1" opens and the batchfile waits until I close "My Program 1", before it continues. I want to keep "My Program 1" open and continue the batch file.I have tried using "Start" & "Start /B". I've tried using "Call" to start "batch file 2", which in turn opens "My Program 1". But, no matter what, "batch file 1" waits until I close "My Program 1", before it continues. I want to get 2 executable files open at the same time.(with the single batch file)
@ECHO OFF"E:\My Program 1\My Program 1.LNK"CLSECHO.ECHO My Message. Do this first.ECHO Now press a key to run Program 2.ECHO.Pause > NUL"E:\My Program 2\My Program 2.LNK"
@ECHO OFFstart "Include Title Here" "E:\My Program 1\My Program 1.LNK"CLSECHO.ECHO My Message. Do this first.ECHO Now press a key to run Program 2.ECHO.Pause > NULstart "Include Title Here" "E:\My Program 2\My Program 2.LNK"
That title can be a blank string (just a pair of quotes) if you don't want or need to alter things in the title bar of your command box, but it needs to be there.
I just want to add that I have found in Win2K & XP, (not Vista yet but it seems to be the same) that I always use a title of some sort with the Start command, as a habit, because of what happens if there are going to be some spaces that need quoting in the program path, name and/or parameters.