Home / Microsoft / Microsoft DOS / Logging batch file
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Logging batch file  (Read 865 times)
nceranek
Topic Starter
Greenhorn



Posts: 9


« on: October 31, 2007, 10:19:57 AM »

New to DOS so please be kind. Using Windows XP SP2.

I created a batch file that redirects to a log file. The processing itself works fine but the moment I try to redirect it seems to loop. Any suggestions or critiques would be great!

Code: [Select]
REM Running NIGHTLY UPDATE/BACKUP

shp2sde -o create...

sdeexport -o create...

sde2shp -o init...

GULF_SDE.bat>"C:\Documents and Settings\nicole.ceranek\Desktop\GULFSDE.log"

EXIT

Also, I heard you can do something similar through Microsoft Scheduler, if so how?
IP logged
WillyW
Mentor



Thanked: 27
Posts: 1,823

Experience: Experienced
OS: Windows XP



« Reply #1 on: October 31, 2007, 10:40:53 AM »

New to DOS so please be kind. Using Windows XP SP2.

I created a batch file that redirects to a log file. The processing itself works fine but the moment I try to redirect it seems to loop. Any suggestions or critiques would be great!

Code: [Select]
REM Running NIGHTLY UPDATE/BACKUP

shp2sde -o create...

sdeexport -o create...

sde2shp -o init...

GULF_SDE.bat>"C:\Documents and Settings\nicole.ceranek\Desktop\GULFSDE.log"

EXIT


What is in     GULF_SDE.bat          ?
Is it calling the main batch file that you posted above?

Please post the text of    GULF_SDE.bat     .



IP logged

.


nceranek
Topic Starter
Greenhorn



Posts: 9


« Reply #2 on: October 31, 2007, 10:43:07 AM »

GULF_SDE.bat is the batch file that is posted above. Is that why its looping?
« Last Edit: October 31, 2007, 11:27:50 AM by nceranek » IP logged
WillyW
Mentor



Thanked: 27
Posts: 1,823

Experience: Experienced
OS: Windows XP



« Reply #3 on: October 31, 2007, 11:46:42 AM »

GULF_SDE.bat is the batch file that is posted above. Is that why its looping?

Yes.
It is calling itself.

Do an experiment.

Code: [Select]
REM Running NIGHTLY UPDATE/BACKUP

shp2sde -o create...

sdeexport -o create...

sde2shp -o init...

EXIT


Save that code in a batch file.   
For this example,   I'll use the filename of  g_sde.bat

At the command line do:

g_sde >> GULFSDE.log


After it completes,   then use a text editor/viewer to read     GULFSDE.log .
Did it work?


Note:    See   
http://www.computerhope.com/forum/index.php/topic,32805.msg197404.html#msg197404
for  explanation of     >     vs.         >>                 .



IP logged

.


CoeMah
Guest
« Reply #4 on: October 31, 2007, 11:49:09 AM »

GULF_SDE.bat is the batch file that is posted above. Is that why its looping?

Pretty much -- as soon as it reaches that line in the batch file it reruns the batch file.
IP logged
nceranek
Topic Starter
Greenhorn



Posts: 9


« Reply #5 on: October 31, 2007, 12:27:50 PM »

That works great, thank you!

Now all I have to do is have that automated in Microsoft Scheduler.
« Last Edit: October 31, 2007, 12:40:59 PM by nceranek » IP logged
WillyW
Mentor



Thanked: 27
Posts: 1,823

Experience: Experienced
OS: Windows XP



« Reply #6 on: October 31, 2007, 12:46:56 PM »

That works great, thank you!

Now all I have to do is have that automated in Microsoft Scheduler.

Great!    Thanks for posting back with your result.   

About scheduler:    I don't have XP, so that is why I didn't comment on that part.
Check back in this thread periodically -  perhaps an XP person will come along and take up that part with you.
Or in the meantime -   experiment with the scheduler yourself.    I bet it is not that complicated to use.   

IP logged

.


nceranek
Topic Starter
Greenhorn



Posts: 9


« Reply #7 on: October 31, 2007, 01:10:31 PM »

Nope. I got it.

Again thank you!
IP logged
WillyW
Mentor



Thanked: 27
Posts: 1,823

Experience: Experienced
OS: Windows XP



« Reply #8 on: October 31, 2007, 01:39:35 PM »

Nope. I got it.

 ;)


Quote
Again thank you!

You're welcome.

Visit with us here often.
IP logged

.


Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / Logging batch file « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.077 seconds with 20 queries.