The System cannot find the file specified error while deleting folder

jestges

Hi can some one suggest me how to delete below folder(abc) using a batch file?

%UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\abc

I tried like RD %UserProfile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\abc /Q /S

But it is not deleting and when I execute the same command in command line it is giving a message like "The System cannot find the file specified" even though it is exists.

Any solution?

twasbrillig

At a command line run:

ECHO %UserProfile%

What does it return?

Open that directory in Windows Explorer and double check that a folder called AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\abc exists in it.

I'm thinking that maybe it doesn't exist, and the folder you're looking at that you said does exist, is in a directory with a root that is different from %UserProfile%.

Update

Open a new command window by doing the following, which ensures that it's in Administrator mode.

On a Shortcut to a command window, Right Click > Properties > Shortcut > Advanced and check the "Run As Administrator" checkbox, and click OK twice. Then run the command prompt via the shortcut. You'll know it worked if it looks like this, with the word "Administrator" in the title, see screenshot below. Then try running your RD command again.

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

The system cannot find the file specified but file exists

CreateProcess error=2, The system cannot find the file specified

How to fix "CreateProcess error=2, The system cannot find the file specified" even if the Path variable is specified (crossplatform)

"The system cannot find the file specified" error on process.Start();

pytesseract,WindowsError: [Error 2] The system cannot find the file specified

CreateProcess error = 2, the system cannot find the file specified error

Error:java: Cannot run program CreateProcess error=2, The system cannot find the file specified

Cassandra - "The system cannot find the file specified"

The system cannot find the file specified while programming C

Subprocess The system cannot find the file specified Error

WindowsError: [Error2] The system cannot find the file specified

Blackberry Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified

The system cannot find the file specified

Sublime Text: "The system cannot find the file specified" error

Windows 10 : cannot delete folder "The system cannot find the file specified"

printf in nodejs execSync gives error - the system cannot find the file specified

The system cannot find the file specified windows error python

AppStartError: CreateProcess: The system cannot find the file specified

Batch file The system cannot find the path specified

Error: "The system cannot find the file specified" when using -r flag

Android Studio The system cannot find the file specified

Flutter: Error: Error when reading '-': The system cannot find the file specified

Fatal error: Uncaught ImagickException: PDFDelegateFailed `The system cannot find the file specified

Pyper error: [WinError 2] The system cannot find the file specified

I get the error :[WinError 2] The system cannot find the file specified:

Error message: createProcess error=2, The system cannot find the file specified

System cannot find file specified

Makefile error (e=2): The system cannot find the file specified

What causes the error "The system cannot find the file specified"?