D_block Posted October 9, 2008 Posted October 9, 2008 when using command prompt in win-xp , the net user command to be exact there is one problem i cant get around. i dont know if its the same on vista too but ...For e.g: if i launch the net user command it normally states the accounts that are on the pc. so say for this instance the accounts on the windows machine are : Administrator, John, sharon, K & S Towne and off course the normal help accounts which are default .given that John has Admin privilages and sharon and K & S Towne are limited users.when im logged in as the Administrator ( which normally is hidden from view ) and all the other accounts are password protected, i usually use the " net user John * " then the return key twice to remove the passwords depending on who or what i, doing , the problem is now. How do i execute any such commands on the K & S Towne Account ? As many times that ive met accounts with more than one word the net user command does work with them. is there a way to execute the net user command on Accounts which have multiple word or names on its ID E.G ( K & S Towne ) Any help will be good !!
IcemanND Posted October 9, 2008 Posted October 9, 2008 enclose the text that has spaces in it with double quotes.Net user "K & S Towne" .......
jaclaz Posted October 9, 2008 Posted October 9, 2008 It is possible that the problem is not in "more than one word" but rather in the use of the "&" sign, which is a reserved character.If the quotes do not work, you can try "escaping" the character, using && instead. jaclaz
D_block Posted October 9, 2008 Author Posted October 9, 2008 well once is the case that i've met the the "&" sign , but the other times it usually is double words like " sexy chick " or " tall man " .. what i remember is that when executing the net user command if i going to change your pass word its basically the same process. "net user <account> <pword>" now by using a log in id with 2 words or more im thinking that maybe windows is reading it as a user name and password ?
jaclaz Posted October 9, 2008 Posted October 9, 2008 By default the "separator" in command line and batches is the "space", thus yes, a program that shoud be called as:program.exe param1 param2 param3will not interpret properly a command line like:program.exe param1 para m2 param3as:1st parameter=param12nd parameter=para3rd parameter=m24th parameter=param3By placing quotes around "para m2" you will obtain:1st parameter=param12nd parameter=para m23rd parameter=param3so with "normal" characters everything will be allright, but if a "reserved" character is used like %&<>=|^ to list a few, putting the two (or three) words between quotes may not be enough.jaclaz
Noise Posted October 9, 2008 Posted October 9, 2008 Did you try:Net user "K %& S Towne" ....... ???Sometimes the percent sign helps
jaclaz Posted October 9, 2008 Posted October 9, 2008 Did you try:Net user "K %& S Towne" ....... ???Sometimes the percent sign helpsWell, NO.The percent sign is the reserved character used to indicate a variable....There are usually two ways to "escape" special characters, either "doubling" them like in "&&" or using the caret, like in "^&", (I presume that the second may work in this case) but the only way to know if either work would be to test them.jaclaz
D_block Posted October 9, 2008 Author Posted October 9, 2008 By default the "separator" in command line and batches is the "space", thus yes, a program that shoud be called as:QUOTE program.exe param1 param2 param3will not interpret properly a command line like:QUOTE program.exe param1 para m2 param3as:1st parameter=param12nd parameter=para3rd parameter=m24th parameter=param3By placing quotes around "para m2" you will obtain:1st parameter=param12nd parameter=para m23rd parameter=param3i more lost now than when i started ..lolan example will do guys and as i said b4 i also get this problem when the account name is 2 words for example " tall man " you know it is very easy to create a limited account on your machine an try doing what i say im getting the problem with , for hands on experience
mafadecay Posted October 9, 2008 Posted October 9, 2008 (edited) Example 1 for username: john smith to reset password to your choice type following from run or cmd prompt (If I use a new line this means press enter key).net user "john smith" * Enter password now (prob shows up in ********)Confirm Password now (again will appear hidden in ********)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------Example 2 for username: John & Joe to reset password typenet user "john && joe" *Enter password now (prob shows up in ********)Confirm Password now (again will appear hidden in ********)If above example 2 fails try the following but I have always used the double and && net user "john ^& joe" *Enter password now (prob shows up in ********)Confirm Password now (again will appear hidden in ********)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------Can I just ask why this is a problem for you? Edited October 9, 2008 by mafadecay
D_block Posted October 10, 2008 Author Posted October 10, 2008 well it is a problem for me because , im going to do a fresh install on a dell machine but i want to preserve all the data on it , i have access to the original Administrator account so i normally use net user to clear passwords to do my back up ... plus ive got this same problem before where there are two words in the id an i jus got fed up of trying an used " Bart PE " to do the job.... so its jus info on my part ill tell u which one worked !!
os2fan2 Posted October 10, 2008 Posted October 10, 2008 File names and parameters with spaces appear in quotes eg "T J Smith"Reserved characters can be escaped with ^, eg ^& or ^" or ^%. The variable %% expands to %.& separates commands on the same line, eg echo hi & goto :end && is a conditional &, the second command is executed if the first succeeds.|| is a conditional or, ie "do something || echo something failed." will say 'something failed' only when it fails.
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