Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Delete folder under C"\windows in cmd line


  • Please log in to reply

#1
Greenturtle168

Greenturtle168

    Member

  • Member
  • PipPipPip
  • 351 posts
Hey
Could someone please help me to delete the folder named Test under C:\window in cmd line. Since the folder Test under C:\window is set as read only. I got something like this
attrib -r C:\windows\test
rmdir /s /q C:\windows\Test.

but the code doesn't work, any help would be appreciated
  • 0

Advertisements


#2
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,148 posts
Hi Greenturtle,

rmdir /s /q C:\windows\Test should work removing the folder even if its read-only and hidden, no need to remove the attributes.

Are you running the Command Line as Administrator? If not it will fail with error Permission Denied
  • 0

#3
Greenturtle168

Greenturtle168

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 351 posts
Hey, SleepyDude,
Oh, you are right,thx, but how to switch from C:\user\<username. to C:\windows\system32 in cmd line.

PS: I know how to run cmd as admin but don't know to do it in cmd
  • 0

#4
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,148 posts

Hey, SleepyDude,
Oh, you are right,thx, but how to switch from C:\user\<username. to C:\windows\system32 in cmd line.

PS: I know how to run cmd as admin but don't know to do it in cmd


Hi,

If you pass to rmdir the complete path C:\windows\Test as argument you don't need to change the folder where you are located.

To change folders you need to use the cd <folder_path> command (Change Dir abbreviated)

cd C:\windows\system32
cd c:\user\MyUser
cd..


Maybe you want to check this page...
  • 0

#5
Greenturtle168

Greenturtle168

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 351 posts
when we change from c:\user\MyUser to C:\windows\system32, does that mean we run the cmd as administrator?
  • 0

#6
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,148 posts

when we change from c:\user\MyUser to C:\windows\system32, does that mean we run the cmd as administrator?


No you have to open the Command Prompt as Administrator like this
  • 0

#7
Greenturtle168

Greenturtle168

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 351 posts
can't do it through cmd line?
  • 0

#8
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,148 posts

can't do it through cmd line?


Not exactly because the process need to be elevated, to do that its necessary some tool to help like this or the Elevation PowerToys for Windows this one includes several useful scripts to add the "Run as Administrator" option to several file extensions and adds the "elevate" command to windows...
  • 0

#9
Greenturtle168

Greenturtle168

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 351 posts
I think that'll do for now, thank you so much for ya help, SleepyDude.
  • 0

#10
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,148 posts

I think that'll do for now, thank you so much for ya help, SleepyDude.


You're welcome. Good luck with your Training... :thumbsup:
  • 0

#11
Greenturtle168

Greenturtle168

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 351 posts
still struggling in Log4 for a while :bashhead:
  • 0

#12
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,148 posts

still struggling in Log4 for a while :bashhead:


It happens, don't give up.
  • 0

#13
Greenturtle168

Greenturtle168

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 351 posts
sure, and you too :)
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP