1.

Solve : Time out?

Answer»

I am WRITING a batch scrip that will give the user the option of backing up files and syncing files or both, and i am wanting to set it that it the user hasn't inputted a selection in a determained set of time (30 SECONDS) it will automatically backup the data.

That is the top part of the batch script. the rest of it is just DEFINING where to copy to and sync from. also i am wanting a way that i can get the batch to zip the backup either before it is copied or after then deleting the uncompressed files.

The batch will be RUN on windows xp

thank you for your help. I greatly appreciate it

ECHO off
:start
cls
ECHO.
ECHO 1. Backup Data
ECHO 2. Sync All About Users Data
ECHO 3. Back up and sync
ECHO 4. Exit
ECHO.
set choice=
set /p choice=Choose and option:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto backup
if '%choice%'=='2' goto sync
if '%choice%'=='3' goto both
if '%choice%'=='4' goto exit
ECHO "%choice%" is not valid please try again
ECHO.Hi, KaMaKaZi_KiNg,

Unfortunately, the set /p will wait indefinitely from the user. The only batch function that will wait a while would be a hidden PING command. Unfortunately, that will not have a prompt.

DOS batch files will not, I'm afraid, do this. Now, if you were talking about C++, Visual Basic or some other programming language you'd have a solution, because you can run a timer in a seperate THREAD from the prompt. But this is impossible in the batch pseudo-language.*censored*.. i dont know any programming language so i guess i'll just have to leave it how it is.

can the zip bit be done or is that a c++ or VB job aswell?

also i am wanting to rename the backup folder to have the date and time on the end of the name. (eg. backup_1428_220906)



Discussion

No Comment Found