Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't delete folder with "reserved word" for a name (Nul)

Status
Not open for further replies.

Maim

Programmer
Jun 25, 1999
106
CA
Hi,
I've just been given administrative control of a machine with Windows 2000 server that people use to run various software to test with.

While doing a clean-up of one of the HDDs, I tried to delete one folder and got a message:
"Cannot delete Nul: the parameter is incorrect."

I opened a cmd and ran "rd /s /q Nul" with the same result.

I rebooted into safe mode and tried again, same result.

I searched the net and found that windows has trouble with certain reserved words (such as Nul) and as yet, I'm unable to find a way to get rid of this folder.

I've set "show all files" including system files for explorer and don't see anything in there. I try CDing into the Nul folder from cmd but that only gives me the incorrect parameter message. I've "taken ownership" with no results.

How can I get rid of this short of formatting the drive (can't, too much data in there)?

-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
 
Maim,
have you tried wild carding?
ie "rd /s /q N?l" or "rd /s /q Nu?" etc.
regards,
longhair
 
Can you rename the folder? And THEN delete it?

-- Jason
"It's Just Ones and Zeros
 
Longhair: doesn't work

jdemmi: "Cannot [delete/rename/move...] Nul: the parameter is incorrect."

Always "the parameter is incorrect."



-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
 
Maim,
try moving with the '~' like you would with long folder names.
regards,
longhair
 
longhair: Doesn't work

The ~ only works when you create a file/folder that doesn't fit the 8.3 rule.

example, go to your c: drive, run dir /x, you should see:
<DIR> DOCUME~1 Documents and Settings
<DIR> PROGRA~1 Program Files
<DIR> WINNT

Notice the WINNT doesn't have an 8.3 format, "cd WIN~1" won't work, and neither does Nul.


-----------------------------------
&quot;Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.&quot; - Rich Cook
 

Tried scripting, nothing.
Tried to "net use" the drive to a machine with visual basic and use fso to delete the folder, I get "permission denied" when I run "fso.DeleteFolder pathToNulFolder, true" or "path not found" when I try to "fso.GetFolder(pathToNulFolder)"


-----------------------------------
&quot;Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.&quot; - Rich Cook
 
Never mind, I'm copying all the data to another drive and formatting it.

Thanks for the suggestions anyway.


-----------------------------------
&quot;Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.&quot; - Rich Cook
 
From the JSIINC website, if you have a dir/file with a reserved word;

If you accidentally create a directory or file with an illegal or reserved name, you cannot delete it normally. To delete it, open a command prompt and type:

del \\.\Drive:\directory\filename
Example: del \\.\c:\someplace\lpt1

Hope this helps for future ref
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top