Jump to content

when using command prompt


D_block

Recommended Posts

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 !!

Link to comment
Share on other sites


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. :unsure:

jaclaz

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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 param3

will not interpret properly a command line like:

program.exe param1 para m2 param3

as:

1st parameter=param1

2nd parameter=para

3rd parameter=m2

4th parameter=param3

By placing quotes around "para m2" you will obtain:

1st parameter=param1

2nd parameter=para m2

3rd parameter=param3

so 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

Link to comment
Share on other sites

Did you try:

Net user "K %& S Towne" ....... ???

Sometimes the percent sign helps

Well, 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

Link to comment
Share on other sites

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 param3

will not interpret properly a command line like:

QUOTE

program.exe param1 para m2 param3

as:

1st parameter=param1

2nd parameter=para

3rd parameter=m2

4th parameter=param3

By placing quotes around "para m2" you will obtain:

1st parameter=param1

2nd parameter=para m2

3rd parameter=param3

i more lost now than when i started ..lol

an 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

Link to comment
Share on other sites

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 type

net 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 by mafadecay
Link to comment
Share on other sites

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 !!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...