batch file - Need a script to do a couple simple things -
i'm not @ coding, learn - it's thing don't make money doing this!.
i computer repair (mostly malware , virus repairs) , use new program on usb stick leaves reports @ root of customer's system drive regardless of letter drive occupies. (this part automated program , isn't part of batch script)
i want copy own icon folder, , copy folder customer's desktop , change folder icon own icon copied in step 1. have done years manually, since i've been using new utility, see possibility of automating process , saving me minute of work. (every minute counts!)
i 2 reasons:
- so customer can see kinds of viruses/malware found , amount of work done
- in hopes customer go through logs , see things downloaded or accidentally installed , more aware in future. (this never works, @ least i've made effort educate!)
this i've got far: (sorry rems, they're there can keep things straight in head) have icon in same directory script run from.
rem copies icon default reports folder @ root of customer's system drive , copies entire folder on customer's desktop copy applogo.ico "%systemdrive%\computer support\" xcopy "%systemdrive%\computer support" "%userprofile%\desktop\computer support" /e /c /i /h /r /k /y /z cd %userprofile%\desktop\computer support rem adds system file attribute attrib +s "computer support" rem changes folder icon 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
this copies original folder root of customer's system drive desktop, , copies logo on - doesn't change desktop folder icon applogo.ico, nor hide desktop.ini
, applogo.ico
files.
***edit: after playing attrib function, added , works hide applogo.ico separately desktop.ini , both hidden - still doesn't change folder icon icon...
rem adds system file attribute attrib +s "computer support" attrib +s +h applogo.ico
so can see i've done wrong?
thank in advance!!
***edit: (the answer)
sorry reply own topic, can considered closed - it's been figured out.
it worked inclusion of pushd command.
check , compare (for wanted know)
rem copies icon default reports folder @ root of customer's system drive copy /y applogo.ico "%systemdrive%\computer support" xcopy "%systemdrive%\computer support" "%userprofile%\desktop\computer support" /e /c /i /h /r /k /y /z rem adds system file attribute pushd "%userprofile%\desktop" attrib +s "computer support" cd "computer support" attrib +s +h applogo.ico rem changes folder icon 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
the folder gets transferred, folder icon gets changed, , icon , desktop ini files both hidden.
the addition of pushd of directory before attrib function did trick. looked, hope helps else same things looking myself.
here's answer:
rem copies icon default reports folder @ root of customer's system drive copy /y applogo.ico "%systemdrive%\computer support" xcopy "%systemdrive%\computer support" "%userprofile%\desktop\computer support" /e /c /i /h /r /k /y /z rem adds system file attribute pushd "%userprofile%\desktop" attrib +s "computer support" cd "computer support" attrib +s +h applogo.ico rem changes folder icon 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
i hope helps out looking trying do! works perfectly.
Comments
Post a Comment