Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
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,977 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,977 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,977 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,977 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,977 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,977 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