MSFN Forum: when using command prompt - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

If you have questions about customizing Windows XP that are nLite-specific, please post them in the nLite forum, not here. If you have questions regarding the unattended installation of Windows XP, please post them in the Unattended Windows 2000/XP/2003 section.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

when using command prompt net user commands Rate Topic: -----

#1 User is offline   D_block 

  • The Return of the greatest
  • PipPip
  • Group: Members
  • Posts: 273
  • Joined: 05-May 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 October 2008 - 08:46 AM

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


#2 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,249
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 October 2008 - 08:59 AM

enclose the text that has spaces in it with double quotes.

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

#3 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,108
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 09 October 2008 - 09:10 AM

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

#4 User is offline   D_block 

  • The Return of the greatest
  • PipPip
  • Group: Members
  • Posts: 273
  • Joined: 05-May 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 October 2008 - 09:54 AM

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 ?

#5 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,108
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 09 October 2008 - 11:32 AM

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

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

#6 User is offline   Noise 

  • Windows Guru
  • PipPipPip
  • Group: Members
  • Posts: 425
  • Joined: 27-February 04

Posted 09 October 2008 - 01:14 PM

Did you try:

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

Sometimes the percent sign helps

#7 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,108
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 09 October 2008 - 01:25 PM

View PostNois3, on Oct 9 2008, 09:14 PM, said:

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

#8 User is offline   D_block 

  • The Return of the greatest
  • PipPip
  • Group: Members
  • Posts: 273
  • Joined: 05-May 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 October 2008 - 03:06 PM

Quote

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

#9 User is offline   mafadecay 

  • Group: Members
  • Posts: 7
  • Joined: 08-October 08

Posted 09 October 2008 - 05:18 PM

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?

This post has been edited by mafadecay: 09 October 2008 - 05:19 PM


#10 User is offline   D_block 

  • The Return of the greatest
  • PipPip
  • Group: Members
  • Posts: 273
  • Joined: 05-May 07
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 October 2008 - 07:10 PM

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

#11 User is offline   os2fan2 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 400
  • Joined: 09-September 04

Posted 10 October 2008 - 03:21 AM

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.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy