soporific Posted December 4, 2006 Posted December 4, 2006 Hi there I'm just finalizing some code for the upcoming alpha release of v4 of the unattended boot cd for Windows 98se and I've come across an interesting curiosity regarding computer names ...I didn't know what the limitations were for computer names in Windows 98se so I thought I'd test them out. I knew there was a character number limit (its 15) and so the code checks for that. Next, I thought that you definitely can't have any spaces in the name so I checked for that. It seems you can!!!I tried using "Blank space" (by going into Network Neighborhood properties , and then the Identification tab) and it accepted it with no worries. I was able to view shared folder files on the network with no worries. But when I tried to set a name with spaces using the Windows XP networking tool, it said that I couldn't use spaces in the name.My question is: which is right? Can you use spaces or not?My research threw up this page: http://www.microsoft.com/technet/archive/w...4.mspx?mfr=truewhich says there must not be any blank spaces. So why does it seems to work?Any help much appreciated! Here's a screenshot of me being able to see via the network, the computer with the blank space in the computer name --- weirdness !!!! And yes i can view the files in those directories.
Jaqie Fox Posted December 6, 2006 Posted December 6, 2006 Patient: "Doctor, when I hold my arm like this, it hurts!"Doctor: "Well, then don't hold your arm like that!"
oscardog Posted December 6, 2006 Posted December 6, 2006 soporific it does matter from a boot point of view, Jaqie Fox can you practice your adolesence elsewhere
Jaqie Fox Posted December 6, 2006 Posted December 6, 2006 (edited) Excuse me? I was trying to give you honest and helpful advice in a humorous manner. Edited December 6, 2006 by Jaqie Fox
soporific Posted December 6, 2006 Author Posted December 6, 2006 Does it really matter?Yes, yes & yes.Yes, from the point of view that I'd prefer my projects to work and not crash people's computers. If I go ahead and not restrict spaces in the computer name, this may occur.Yes because I haven't written any code to restrict spaces, and I'd prefer not to if I don't have to.And yes from the point of view that understanding stuff is always better than not understanding it.There's enough confusion already in the world!! I mean, most people don't recognise that capitalism is a system of exploitation and oppression when it totally is ...
LLXX Posted December 6, 2006 Posted December 6, 2006 Any problems arising from the use of spaces so far?If not, then it's a good assumption that M$ just maybe was thinking about something else at the time.I wouldn't put any restrictions in my code, only let the restrictions be the stricter of the code itself or the underlying API.As in your case the API seems to be doing fine with it, I wouldn't worry.Just like detecting invalid characters in a filename is the OS's job, and all you need to do is pass ASCIIZ strings to the functions.It will eliminate many redundant checks in your code, and possibly make it forward-compatible.An excellent example is the filename one above; back in the days of DOS I had already understood that the file paths for the (then) new filefunctions were passed as ASCIIZ strings, and did not make any assumptions about their content. Those programs back then that I wrote now work for long filenames with spaces and whatever else characters there are (as long as not null - because that was the delimiter), all because I made sure to not treat filenames as being in a fixed format (which is up to the OS to decide, after all.)Same goes for your computer names. If your APIs use ASCIIZ strings, pass them what the user gives and don't care about what's in them.
soporific Posted December 11, 2006 Author Posted December 11, 2006 Any problems arising from the use of spaces so far?No, and I think your explanation makes good sense from what I'm experiencing. I haven't bothered to add any code to check for spaces ... I'll deal with it if it comes up. Thanks for your reply ...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now