Making forbidden file names problem

November 11, 2011 at 07:27:55
Specs: Windows 7
The command md \\.\C:\CON works on my hard drive but not on an external one. E.g The drive is named K: If i run md \\.\K:\CON it does not work, i just get access denied. I have tried cd K: and then running the code but that did not result successful nor did it help in any way. I would appreciate a better understanding of how the code can be modified to work for other drives.

See More: Making forbidden file names problem

Report •


#1
November 11, 2011 at 07:42:25
To switch the current drive you have to type e.g. K: not CD that just changes the current directory but NOT the drive. And avoid the strange \\.\ since by default you operate the PC you are sitting in front of. More avoid use CON as a directory name since it is a builtin device name marking the system console, i.e. keyboard/display.

Report •

#2
November 11, 2011 at 07:57:20
Sorry no, actually now i remember i did do K: forget about that. Your post was not helpful either.

Report •

#3
November 11, 2011 at 08:08:52
Obviously my post was not helpful since it started from a misplaced beginning: your post. Please, clarify *exactly* what you are trying to achieve and how, then I or some more skilled guy/gal may help.

Report •

Related Solutions

#4
November 11, 2011 at 08:41:18
Why do you want to create a directory called "con". It's asking for trouble.

Report •

#5
November 11, 2011 at 08:58:44
To quote from MSDN:
Do not use the following reserved device names for the name of a file:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.

So the better question is what are you doing, and why are you doing it?

How To Ask Questions The Smart Way


Report •

#6
November 11, 2011 at 13:36:03
If you say to respondees that their responses were not helpful then neither they or anyone else is likely to bother. Remember that helpers do this in their spare time free of charge so if their advice does not suit you then just ignore it.

Report •

#7
November 11, 2011 at 15:07:59
What filesystem is the external drive formatted with?

The internal drive is probably NTFS, which supports the names, but maybe the filesystem on the external drive doesn't.


Report •

#8
November 12, 2011 at 02:32:15
I need it so people do not delete my folder easily on the server. Secondly, the command needs to be modified in the way that it will create the con file name currently it only works on the hardrive "c:". I do not care the slightest if it causes a problem, it wont be that serious either if it does there is always a solution and no i do not want to create a rar/zip file instead.

Report •

#9
November 12, 2011 at 04:03:28
There are far better ways of ensuring that folders and files cannot be deleted on a server. NTFS permissions is the obvious answer, and there are others. Something that anyone with a modicum of knowledge can circumvent is hardly much security.

Anyway, I'll leave you to do your own research.


Report •

#10
November 12, 2011 at 08:30:38
There are times when I wish thread locking was permitted. This is one of those times.

Don't make me delete this thread.

How To Ask Questions The Smart Way


Report •

#11
November 13, 2011 at 01:46:28
Then why don't just help? Its pretty straight forward and simple for an experienced person in this area. If it causes a problem so be it, any script that is misused can cause a problem it is my fault and my responsibility what happens when i use it having in mind all the warnings already given.

Report •

#12
November 13, 2011 at 09:22:46
Creek,

You have been told that using reserved names for folder names will cause problems.

You have also been told of the correct way to do what you want.

So why do you insist on using square wheel when it is obvious that you need round ones.

Any one with any experience wll not even attempt to devise a script to do something that the Operating System specifically prohibits. If you think you know better than Microsoft then go ahead, but experienced people use the tools and methods the way they were designed to be used.

Look up permissions in the help files. Its all there.

Stuart


Report •


Ask Question