haven't touched batch files in a long while, but knowing there's some server admins on here I was wondering if you could tell me if its possible to:
check todays date if its a monday, copy folder x to destination z:/monday if its tuesday, copy folder x to detination z:/tuesday etc... Thanks in advance PS: OS = Win2k server |
A possible solution:
FOR /F "tokens=1" %i in ('DATE /T') do set today=%i IF NOT "%today"=="Mon" GOTO next copy x to y:\monday GOTO the_end :next IF NOT "%today"=="Tue" GOTO next copy x to y:\tuesday GOTO the_end ..and so on. |
Hi, thanks for that. I couldn't get your code to work so I had a look at the FOR command and made the following changes...
FOR /F "tokens=1" %%i in ('DATE /T') do set today=%%i IF NOT "%today%"=="Mon" GOTO tuesday copy "file.txt" monday GOTO the_end :tuesday IF NOT "%today%"=="Tue" GOTO wednesday copy "file.txt" tuesday GOTO the_end :wednesday :the_end thnaks mate, -DV |
is it possible to incorporate winzip into batch commands ?
I need to compress some files before moving them to a destination folder |
|
cheers jack
|
DazV = paula_k ?
Forgot to change back after the weekend Daz ? ;) |
B U S T E D !
|
its a fair cop, I masquerade as a woman by day
by night, a sexually deviant necrophiliac with a penchant for beastiality ...or am I just flogging a dead horse ? |
lol :D
|
anyone know if its possible to use command lines to control a cd rewriter ?
eg. xcopy to d: (where d: is the rewriter) ? |
Hi, thanks for that. I couldn't get your code to work so I had a look at the FOR command and made the following changes... Can't believe I missed the terminating % on the today environment variable as well. Sheila ;) |
http://rikwakefield.com/software/createcd.zip
CreateCD [options] <FILESPEC>[<FILESPEC>]... options - one or more of the following: -e[rase] - Erase disk before writing -f[ullerase] - Erase disk and quit. This is 'full" erase that takes quite some time -nologo - Do not display logo string -r[ecorder]:<LETTER> - Use recorder <LETTER> -s[peed]:<NUMBER> - Use recording speed <NUMBER> -v[erbose] - Produce more output -info - Print recorder/disk information and exit -eject - Eject disk after writing -l[abel]:<VOLUME label> - Set volume label. Default is today's date -i[mage]:<FILESPEC> - Make disk bootable using image <FILESPEC>. <FILESPEC>should be an image of a bootable floppy Example: CreateCD -r:e -i:bootflpW98.img C:\Data\*.* Rik :) |
cool
|
All times are GMT +1. The time now is 06:58 AM. |
© 2024 MH Sub I, LLC dba Internet Brands