Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: wierd batch file behavior

HTVi
TV Discussion Newsgroups

wierd batch file behavior
Sasi 5/28/2007 5:14:01 PM
this is the batch file I've written:


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

net user /add Admin ~![ at ]#$%^&*()_+ /domain
net user Admin ~![ at ]#$%^&*()_+ /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.
Re: wierd batch file behavior
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 5/29/2007 12:14:05 AM
This is not weird batch file behaviour, as you should always expect trouble
when dealing with special characters. In addition to having syntactical
meaning to cmd.exe, some characters may not be accepted as valid password
characters (but I do not know that for a fact).

If you would change the password to something a little less likely to cause
problems (i.e. all letters and digits), then I think you will find it works.

Try these commands:

set zzz=~![ at ]#$%^&*()_+
set zzz

and I think you will see that zzz was set to ~![ at ]#$%&*()_+ rather than to
~![ at ]#$%^&*()_+


/Al

"Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
news:6DB3B216-CDAE-476F-994B-DEB7F01FC069[ at ]microsoft.com...
[Quoted Text]
> this is the batch file I've written:
>
>
> net user /add Admin ~![ at ]#$%^&*()_+
> net user Admin ~![ at ]#$%^&*()_+
> net localgroup Administrators /add Admin
>
> net user /add Admin ~![ at ]#$%^&*()_+ /domain
> net user Admin ~![ at ]#$%^&*()_+ /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.


Re: wierd batch file behavior
"Jeremy" <jeremy[ at ]discussions.microsoft.com> 5/29/2007 9:49:48 AM
Its the ampersand screwing it up. This means to run two command in the CMD
shell.

So if you wrote:

ECHO FOO&cmd.exe
This would echo FOO to the current CMD shell and the spawn a new one.

It wont be particularly happy with the brackets either, but this may still
work since you don't have a FOR loop or an IF statement.

"Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
news:6DB3B216-CDAE-476F-994B-DEB7F01FC069[ at ]microsoft.com...
[Quoted Text]
> this is the batch file I've written:
>
>
> net user /add Admin ~![ at ]#$%^&*()_+
> net user Admin ~![ at ]#$%^&*()_+
> net localgroup Administrators /add Admin
>
> net user /add Admin ~![ at ]#$%^&*()_+ /domain
> net user Admin ~![ at ]#$%^&*()_+ /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.

Re: wierd batch file behavior
Sasi 5/30/2007 8:01:00 PM
so what do you guys suggesting? based on your comments what would the
password be?
I tested al dunbar's SET command and it was exactly as he said.it omitted ^
sign.but the remaining 12 character sequence was not the password.
I also tested jeremys' .according to him it must be ~![ at ]#$%^ ;but it was not
neither.

"Jeremy" wrote:

[Quoted Text]
> Its the ampersand screwing it up. This means to run two command in the CMD
> shell.
>
> So if you wrote:
>
> ECHO FOO&cmd.exe
> This would echo FOO to the current CMD shell and the spawn a new one.
>
> It wont be particularly happy with the brackets either, but this may still
> work since you don't have a FOR loop or an IF statement.
>
> "Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
> news:6DB3B216-CDAE-476F-994B-DEB7F01FC069[ at ]microsoft.com...
> > this is the batch file I've written:
> >
> >
> > net user /add Admin ~![ at ]#$%^&*()_+
> > net user Admin ~![ at ]#$%^&*()_+
> > net localgroup Administrators /add Admin
> >
> > net user /add Admin ~![ at ]#$%^&*()_+ /domain
> > net user Admin ~![ at ]#$%^&*()_+ /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.
>
Re: wierd batch file behavior
"Jeremy" <jeremy[ at ]discussions.microsoft.com> 5/31/2007 8:20:53 AM
Try the command without the & or the ^ or the () this should work.
"Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
news:598BFBB6-808F-4C54-BA1F-7CFADC684F52[ at ]microsoft.com...
[Quoted Text]
> so what do you guys suggesting? based on your comments what would the
> password be?
> I tested al dunbar's SET command and it was exactly as he said.it omitted
> ^
> sign.but the remaining 12 character sequence was not the password.
> I also tested jeremys' .according to him it must be ~![ at ]#$%^ ;but it was
> not
> neither.
>
> "Jeremy" wrote:
>
>> Its the ampersand screwing it up. This means to run two command in the
>> CMD
>> shell.
>>
>> So if you wrote:
>>
>> ECHO FOO&cmd.exe
>> This would echo FOO to the current CMD shell and the spawn a new one.
>>
>> It wont be particularly happy with the brackets either, but this may
>> still
>> work since you don't have a FOR loop or an IF statement.
>>
>> "Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
>> news:6DB3B216-CDAE-476F-994B-DEB7F01FC069[ at ]microsoft.com...
>> > this is the batch file I've written:
>> >
>> >
>> > net user /add Admin ~![ at ]#$%^&*()_+
>> > net user Admin ~![ at ]#$%^&*()_+
>> > net localgroup Administrators /add Admin
>> >
>> > net user /add Admin ~![ at ]#$%^&*()_+ /domain
>> > net user Admin ~![ at ]#$%^&*()_+ /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.
>>

Re: wierd batch file behavior
Sasi 6/1/2007 4:10:01 PM
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.

"Jeremy" wrote:

[Quoted Text]
> Try the command without the & or the ^ or the () this should work.
> "Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
> news:598BFBB6-808F-4C54-BA1F-7CFADC684F52[ at ]microsoft.com...
> > so what do you guys suggesting? based on your comments what would the
> > password be?
> > I tested al dunbar's SET command and it was exactly as he said.it omitted
> > ^
> > sign.but the remaining 12 character sequence was not the password.
> > I also tested jeremys' .according to him it must be ~![ at ]#$%^ ;but it was
> > not
> > neither.
> >
> > "Jeremy" wrote:
> >
> >> Its the ampersand screwing it up. This means to run two command in the
> >> CMD
> >> shell.
> >>
> >> So if you wrote:
> >>
> >> ECHO FOO&cmd.exe
> >> This would echo FOO to the current CMD shell and the spawn a new one.
> >>
> >> It wont be particularly happy with the brackets either, but this may
> >> still
> >> work since you don't have a FOR loop or an IF statement.
> >>
> >> "Sasi" <Sasi[ at ]discussions.microsoft.com> wrote in message
> >> news:6DB3B216-CDAE-476F-994B-DEB7F01FC069[ at ]microsoft.com...
> >> > this is the batch file I've written:
> >> >
> >> >
> >> > net user /add Admin ~![ at ]#$%^&*()_+
> >> > net user Admin ~![ at ]#$%^&*()_+
> >> > net localgroup Administrators /add Admin
> >> >
> >> > net user /add Admin ~![ at ]#$%^&*()_+ /domain
> >> > net user Admin ~![ at ]#$%^&*()_+ /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.
> >>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen