Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Delete specified folders through windows CMD

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 20-04-2009
Member
 
Join Date: Apr 2009
Posts: 79
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

Reply With Quote
  #2  
Old 20-04-2009
Member
 
Join Date: Mar 2008
Posts: 232
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.
Reply With Quote
  #3  
Old 20-04-2009
Member
 
Join Date: Dec 2008
Posts: 161
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
Reply With Quote
  #4  
Old 20-04-2009
Member
 
Join Date: Feb 2009
Posts: 53
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)?
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Delete specified folders through windows CMD"
Thread Thread Starter Forum Replies Last Post
Windows 7: Unable to Delete documents or file folders jpmlists Windows Software 2 30-08-2011 08:47 PM
Delete Folders in Windows Media Center library longevity Vista Help 2 16-03-2011 10:25 AM
delete the folders windows downloaded installations and service pack files ? prash_mate Windows XP Support 3 05-11-2008 03:06 AM
how to delete old profile folders Duncan McC Active Directory 2 24-09-2008 05:53 PM
Can't delete folders or files Robert Vista Help 4 28-04-2008 01:55 AM


All times are GMT +5.5. The time now is 03:47 PM.