Jump to content

Recommended Posts

Posted (edited)

How write this skript for delete thisone folder of C;,D:,E:,F: etc.

cmdow @ /HID
@echo off

rd "C:\Documents and Settings\Administrator" /s /q
md " C:\Documents and Settings\Administrator"

Edited by Yurek3

Posted (edited)

I did thisone script

cmdow @ /HID
@echo off
FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO
rd "%%i\Documents and Settings\Administrator" /s /q


FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO
md "%systemdrive%\Documents and Settings\Administrator"

And nextone

cmdow @ /HID
@echo off

rd "C:\Documents and Settings\Administrator" /s /q
md " C:\Documents and Settings\Administrator"

rd "D:\Documents and Settings\Administrator" /s /q
md " D:\Documents and Settings\Administrator"

rd "E:\Documents and Settings\Administrator" /s /q
md " E:\Documents and Settings\Administrator"

rd "F:\Documents and Settings\Administrator" /s /q
md " F:\Documents and Settings\Administrator"


rd "G:\Documents and Settings\Administrator" /s /q
md " G:\Documents and Settings\Administrator"

and next

cmdow @ /HID
@echo off

rd "%systemdrive%\Documents and Settings\Administrator" /s /q
md "%systemdrive%\Documents and Settings\Administrator"

Edited by Yurek3
Posted

Your scripts do different things and are sometimes inconsistent. The second part of the first is the strangest of all.

I'm not sure of what you want to do but I assume that you want to delete them all and recreate them all.

You can do that like this:

FOR %%I IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
IF EXIST %%I:\ IF EXIST "%%I\Documents and Settings\Administrator" (
RD/Q/S "%%I\Documents and Settings\Administrator"
MD "%%I\Documents and Settings\Administrator"
)
)

Whether it will work is something else. Isn't that folder protected?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...