MSFN Forum: batch file help - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

batch file help Rate Topic: -----

#1 User is offline   xe0net 

  • Group: Members
  • Posts: 1
  • Joined: 17-April 08

Posted 17 April 2008 - 04:04 AM

Hi, i have a batch file that runs the following

 
@echo off
cls
cd C:\photo\
ftp -i -s:ftpupload.txt
 



what i want to do is set an 'alarm' of types up, so if the ftp upload hangs for 10minutes it will disconnect the session.

anyone got any ideas?


#2 User is offline   tguy 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 698
  • Joined: 19-May 04

Posted 24 April 2008 - 12:44 PM

How about calling sleep.exe or wait.exe and set to 10 minutes or 600 seconds?

eg: call sleep.exe 600

Then use an error return code to check to see if ftp was successful or not and if not use kill.exe or pskill.exe to terminate the ftp process.

eg: Errorreturn

Just some thoughts.

You could also use vbScript to do everything you need plus the steps I mentioned above without having to call separate executables.

#3 User is offline   Smiley357 

  • Junior
  • Pip
  • Group: Members
  • Posts: 85
  • Joined: 12-October 07

Posted 24 April 2008 - 02:39 PM

 
ping -n 10 127.0.0.0 > nul 

You can also use this to sleep/wait for 10 seconds. Just change the 10 to however long you want it to sleep/wait. With this you will not have to put the sleep.exe or wait.exe on your computer.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy