|
Answer» I have been going through some files on a customers server, the old 'IT' guy was a bit of a whizz but stupid with it and lost his job due to stupidity and pron.
Going through the old server I inherited I found this batch file, I understand that its designed to copy files from one drive to another and probably write a TEXT file at the end of copying, but I can't QUITE grasp the way its been written. I frequently use batch files myself and now prefer these to drag and drop as they seem quicker and I dont have to watch that stupid folder and flying paper crap ..... it MAY be an illusion but thats my preference.
The file in question is below, and my main boggle is whats with the ">" in the middle? Is this some sort of "xcopy" shorthand??
"\\SERVER1\120gig (H)\Backup\COPY TO BACKUP SERVER.BAT" > "\\SERVER1\120gig (H)\Backup\backup.txt"
I LOOK forward to you educated and varied replies.
Many ThanksThe ">" redirects the output from the batch to a file. So while the batch script would NORMALLY output text to the console, with the ">" it instead writes it to "backup.txt".
With one ">" the text will be written to the beginning of the file, overwriting anything currently in it. If you instead use two ">>" the text will be written to the end of the file, thereby appending the text instead of overwriting.
Check out this site for more redirection action: http://www.ss64.com/ntsyntax/redirection.html
Many thanks, its very useful to know. Now that I know exactly what it does I may well start incorporating it into a few "batches".
Many thanks for your help.
|