I've posted this in xide's thread in D7II Feature Suggestions, but I felt that I needed to clarify and post in here in hopes that someone with more batch experience would chime in. I reposted it because it's not quite the same thing he's trying to accomplish, but I do think that the answer for what I'm trying to do is going to be similar to his answer...
For years, I've saved malware logs to my customer's desktop for 2 reasons.
1) To show the customer what I've found and work that's been done.
2) In hopes that the customer will go through the logs and see what they had on their systems and not download those types of things again.
.....(which rarely works, but at least it looks like I'm trying to help them by giving them the information necessary to help keep themselves clean)
Now that all of our logs are located in one place (in the D7II Reports folder at the root of the customer's computer), this should be a straight shot to what I want to accomplish.
Here's my endgame:
I want to copy the D7 Reports folder to the customer's desktop but leave a copy at the root of their system drive.
I also want to copy my applogo.ico icon into the same folder on the customer's desktop AND have the script change the folder icon to MY logo on their desktop - easy to see, all information right there for them.
I'm not good at coding AT ALL, and have struggled with this for a few hours with VERY limited success.
Here's what I've got so far. (it started out as 3 different batch files and I've whittled it down to 1 via trial and error manually within CMD at the root\Psychlone Support folder)
(I've changed my D7II Reports folder name to Psychlone Support, same default location at %systemdrive%\)
- Code: Select all
REM THIS COPIES MY ICON TO THE DEFAULT REPORTS FOLDER AT THE ROOT OF THE CUSTOMER'S SYSTEM DRIVE
copy applogo.ico "%systemdrive%\Psychlone Support\"
REM THIS PART COPIES THE ENTIRE REPORTS FOLDER TO THE CUSTOMER'S DESKTOP
copy "%systemdrive%\Psychlone Support" "%userprofile%\Desktop"
REM THIS CHANGES THE DIRECTORY TO THE CUSTOMER'S DESKTOP FOR THE FUNCTIONS BELOW TO WORK
REM THIS CHANGES THE DIRECTORY TO THE NEWLY COPIED DESKTOP FOLDER
CD "Psychlone Support"
REM THIS ADDS THE SYSTEM FILE ATTRIBUTE
ATTRIB +s "Psychlone Support"
REM THIS CHANGES THE FOLDER ICON TO MY OWN ICON
ECHO [.ShellClassInfo] >> desktop.txt
ECHO ConfirmFileOp=0 >> desktop.txt
ECHO NoSharing=1 >> desktop.txt
ECHO IconFile=applogo.ico >> desktop.txt
ECHO IconIndex=0 >> desktop.txt
ECHO InfoTip= >> desktop.txt
CHCP 1252 >NUL
CMD.EXE /D /A /C (SET/P=ÿþ)<NUL > desktop.ini 2>NUL
CMD.EXE /D /U /C TYPE desktop.txt >> desktop.ini
DEL /F /Q desktop.txt
ATTRIB +S +H desktop.ini applogo.ico
OK, so what happens here is that the folder at root gets my icon, but the folder doesn't get copied to the user desktop - only the applogo.icon does. I'm so close I can taste it, but it's eluding me!!!
I would like to run this automatically at END SESSION, but am unclear if this can work from a Custom App, from MAIN > CONFIG > CUSTOM FUNCTIONS > d7II End Session, OR from the SCRIPTS in the main D7II GUI...
What am I missing? I KNOW this is easier than I'm making it, I just can't see what I'm doing wrong.
I admit that I suck at batch scripting. I'm lucky that I don't make my money in coding!!
Thanks guys for any information you can pass along!!