Delete specified folders through windows CMD
Is there any programs that will erase all files in stored in a particular folder except those files which i have not mentioned in the program, I have little code to do please check and suggest whether it will do:
Code:
for /d %%a in (%1) do if /I not %%a == %2 rmdir /s /q %%a
but am facing one problem when i execute this i delete all files which i have not suggested to do, does anyone know how to achieve this,by this we can set the workflow.
Thanks in Advance
Re: Delete specified folders through windows CMD
Quote:
Commands called in the [GuiRunOnce] section process synchronously. Each application runs in the order listed in this section, and each command must finish before you run the next command.
Each line specifies a command that the [GuiRunOnce] registry entry executes, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Runonce
HKLM\...\RunOnceEx (ROE) waits for executions to finish, then HKLM\...\RunOnce starts and waits for executions, then HKLM\...\Run starts it's executions, then the desktop loads with the start of HKCU\...\RunOnce (GRO) executions along with the startup folders.
Re: Delete specified folders through windows CMD
You may run cleanup.cmd here i will provide you the code for CMD:
Code:
cmdow @ /HID
psshutdown.exe -r -f -t 30 -c "Cleaning installation; XP will restart in 30 seconds..."
net user aspnet /delete
FOR %%? IN (log tmp) DO (DEL/A/S/F/Q "%SYSTEMROOT%\*.%%?")
DEL "%AllUsersProfile%\Start Menu\Microsoft Update.lnk"
DEL "%AllUsersProfile%\Start Menu\Programs\Internet Explorer.lnk"
DEL "%UserProfile%\Start Menu\Programs\Internet Explorer.lnk
DEL "%UserProfile%\Local Settings\Temp\*.*"
RD /S /Q %UserProfile%\My Documents\
RD /S /Q %AllUsersProfile%\Documents\
RD /S /Q %systemdrive%\Install\
RD /S /Q %systemdrive%\dot20\
EXIT
Re: Delete specified folders through windows CMD
With Cmd.exe or with Command.com or by clicking Command Prompt - or some other way? Are you using the Dir command? With what switches? Have you dealt with any Attributes (Hidden,System)?