Solved, see http://www.cn-dos.net/forum/viewthread.php?tid=27658&page=1&sid=FB2nu4#pid174202 Post 2 building ZH159 brother's answer.
Below is my code, please modify
The content in PurgeS.SVE is as follows:
Everyone should have understood the meaning of my code. I am using the RAR program to compress and back up all the files in the folder specified in PurgeS.SVE to the current BACKUP directory. But when running to SYSTEM32\dllcache with subdirectories, an error occurs, prompting that the path of the compressed file to be backed up is not found. Because I want to back up directly to the BACKUP directory regardless of whether there are subdirectories, and determine the name of the compressed file with the name of the last subdirectory of the directory. For example, the backup of SYSTEM32\dllcache should be dllcache.rar and must be in the BACKUP directory.
I hope everyone can give me a solution idea or code. It is required to use batch processing, not use VBS, and the running environment is WINXP. Thank you.
Regarding the RAR command, I just sent my study notes to http://www.cn-dos.net/forum/viewthread.php?tid=27657&sid=FB2nu4, which can be referred to.
There is a new problem in building 17, waiting online for the masters' answer again
[ Last edited by HUNRYBECKY on 2007-2-14 at 03:09 AM ]
Below is my code, please modify
@ECHO OFF
SET PATH=%CD%;%CD%\TOOLS\;%PATH%
FOR /F "EOL=;DELIMS=" %%I in (.\Purge\PurgeS.SVE) DO (
ECHO Compressing and backing up files under %windir%\%%I\, please wait...
PING 127.0.0.1 -n %TIMEOUT% >NUL
RAR.EXE A -EP3 -IDQ ".\BACKUP\%%~nI" "%windir%\%%I"
)
PAUSE
The content in PurgeS.SVE is as follows:
; Here you can set the system-level garbage files to be backed up and cleaned. They must be represented by folders and must be represented with %windir% as the root.
; If font cleaning is set, you need to set the font files to be retained in FONTS.SVE.
; Input method cleaning should be carried out separately in IME.SVE.
;
;
; Folders that can be backed up and cleaned. If you want to retain them, use ; to comment out the items to be cleaned; you can also add the contents of other folders that need to be backed up and cleaned, such as the wallpapers under Web\Wallpaper
; Fonts
FONTS
; Help
HELP
; Help support center
PCHealth
; Driver cache
Driver Cache
; DLL cache
SYSTEM32\dllcache
; System repair backup
REPAIR
; Prefetch
prefetch
; Search assistant
srchasst
; Microsoft Agent
msagent
; System activation (only for VOL version)
; system32\oobe
Everyone should have understood the meaning of my code. I am using the RAR program to compress and back up all the files in the folder specified in PurgeS.SVE to the current BACKUP directory. But when running to SYSTEM32\dllcache with subdirectories, an error occurs, prompting that the path of the compressed file to be backed up is not found. Because I want to back up directly to the BACKUP directory regardless of whether there are subdirectories, and determine the name of the compressed file with the name of the last subdirectory of the directory. For example, the backup of SYSTEM32\dllcache should be dllcache.rar and must be in the BACKUP directory.
I hope everyone can give me a solution idea or code. It is required to use batch processing, not use VBS, and the running environment is WINXP. Thank you.
Regarding the RAR command, I just sent my study notes to http://www.cn-dos.net/forum/viewthread.php?tid=27657&sid=FB2nu4, which can be referred to.
There is a new problem in building 17, waiting online for the masters' answer again
[ Last edited by HUNRYBECKY on 2007-2-14 at 03:09 AM ]

