My first post:"Have the need to backup all my Desktop files and folders at the end of the day to my thumbdrive"..
Squashman post: "Not quite understanding what you mean by when you say it saved you some extra code lines"..
"Using the ampersand the way you are using it just makes your code unreadable"..
Squashman, sorry if you found my code hard to read or understand for you. Below is my final batch
Now let's do the Math.
Code: Select all
@echo off&color a&mode con:cols=75 lines=20&title[ DESKTOP BACKUP WITH DATE STAMP ]
set DirDate=%date:~4,2%-%date:~7,2%-%date:~10,4%
md "e:\%DirDate%"&xcopy /yisdef "%userprofile%\desktop\*.%1" "e:\%DirDate%">nul
7z.exe a "e:\%DirDate%.7z" "e:\%DirDate%">nul&rd "e:\%DirDate%"/q/s
exit
1. 2 lines less - @echo line grouped commands together on oneliner
2. 4 lines less - Left off the usual remarks/comments.
3. 2 lines less - Main code body was consolated together - saved 2 lines
4. 5 lines less - No dbl spacing between code lines.
================+
13 LINES LESS!
So I quess for the visually impaired or if I had been contracted to do this batch for someone I would have done everthing in Uppercase, lots of comments for better understanding of whats going on, the main body of code would have been dbl spaced and commands on seperate lines for easier reading, xcopy switches would also have had the fwd slash after each switch instead being all bunched together making for better eye candy and improved comprehension...
My bad if I didn't make my orginal post clear enought to you that this batch was just being written for my own purposes to back-up all my desktop crap at the end of the day. So if i didnt you can spank me..