wierd batch file behavior

G

Guest

this is the batch file I've written:


net user /add Admin ~!@#$%^&*()_+
net user Admin ~!@#$%^&*()_+
net localgroup Administrators /add Admin

net user /add Admin ~!@#$%^&*()_+ /domain
net user Admin ~!@#$%^&*()_+ /domain
net localgroup Administrators /add Admin /domain


it is supposed to create an account named "Admin" in case of laking such
account,set and/or change its password to the 13 consequent keys of the upper
row of a standard keyboard (tilda,exlamation,at sign,sharp,and etc till
backspace),and finally make that account an administrator.
the problem is that the account is created and it IS joined to the
administrators group,both locally and on domain;but the password is not set
as expected.I tried everything I would think of,but none was the password it
has set.
I want to know ,considering exactly the script text above,what the Admin
password would be.
I've scheduled this batch file to be run every week on a remote computer and
I have no access to it to change the designated password,so I need to recover
this password.
 
A

Al Dunbar

Sasi said:
this is the batch file I've written:


net user /add Admin ~!@#$%^&*()_+
net user Admin ~!@#$%^&*()_+
net localgroup Administrators /add Admin

net user /add Admin ~!@#$%^&*()_+ /domain
net user Admin ~!@#$%^&*()_+ /domain
net localgroup Administrators /add Admin /domain


it is supposed to create an account named "Admin" in case of laking such
account,set and/or change its password to the 13 consequent keys of the
upper
row of a standard keyboard (tilda,exlamation,at sign,sharp,and etc till
backspace),and finally make that account an administrator.
the problem is that the account is created and it IS joined to the
administrators group,both locally and on domain;but the password is not
set
as expected.I tried everything I would think of,but none was the password
it
has set.
I want to know ,considering exactly the script text above,what the Admin
password would be.
I've scheduled this batch file to be run every week on a remote computer
and
I have no access to it to change the designated password,so I need to
recover
this password.

You see, that is the problem with multi-posting all over the place. I
provided an answer in another newsgroup, yet you don't seem to have seen it.

To recap: if you insist on using special characters in the password, you
might find you need to escape them. In this case, I think you need to double
the "^", i.e.:

net user /add Admin ~!@#$%^&*()_+

My preference, however, is to avoid special characters.


/Al
 
G

Gary Smith

Sasi said:
this is the batch file I've written:
net user /add Admin ~!@#$%^&*()_+
net user Admin ~!@#$%^&*()_+
net localgroup Administrators /add Admin
net user /add Admin ~!@#$%^&*()_+ /domain
net user Admin ~!@#$%^&*()_+ /domain
net localgroup Administrators /add Admin /domain
I have no access to it to change the designated password,so I need to recover
this password.

I suggest trying ~!@#$%&*()_+ (no circumflex) or ~!@#$% and then modify
your batch file to avoid the use of ^ (circumflex), & (ampersand) and !
(exclamation point). While you can probably find a way to make your
original password work, it certainly isn't worth the effort. "QWERTYUIOP"
would be just as secure, and the alpha characters have no side-effects to
be concerned with.
 
G

Guest

thank you both guys.
based on your comments,I ran the batch file in a cmd window and watched it
carefully.
it actually ommited both % and ^ symbles during execution;so the password
will be the whole 13 sequence,without % and ^ symbols.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top