Re: SC.exe Config

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thanks :)
I have been spending much of today reading this rather excellent little gem:
http://www.microsoft.com/MSPress/books/reviews/default.aspx?id=6787&isbn=0-7356-2038-5
And I now see what you say about the variables.
My scripting in *nix is limited, but this is my first attempt at scripting
from scratch in Windows, so I'm learning as I go along.

PERL is a bit out of my league, but I wil definitely peruse the newsgroup
you suggested...

Thanks again,
Lars Petersson
MCSA: Messaging

"Herb Martin" wrote:


"Lars Petersson" <LarsPetersson@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:52E93438-0E1A-4214-BD2A-4E05C1D0CEC5@xxxxxxxxxxxxxxxx
I'm having to change the account used by some services spread over a vast
number of servers and naturally I don't want to do this manually.

Unfortunately the organisation I work for is overly secure, so the
password
for the accounts to be used are not known by any one person.
Instead each password is broken down into two halves and two different
people would have each half.
The command I think I will need to use is essentially:
sc config $Service_Name obj= [DOM\User] password=$pass1$pass2

But what I need to know and haven't been able to find out is this:
Is the SC command clever enough to be able to pull each half of the
password
from a text file.

Not as you state it.

As in, I have a text file with the first half ($pass1) and another with
the
second half ($pass2).
Or would it set the password to $pass1$pass2?

It looks like you have (some) Unx/Linux scripting experience, since Windows
uses either %variable% for environment variables, %%a for batch file
iteration variables.

You are likely to be disappointed at the clunky support for command line
replacement in Windows (it inherits much from DOS), although it is quite
full, it isn't as seemless or straightforward as Linux type machines.

Usually when it gets this complicated, I write a Perl script to CREATE the
Windows commands, or I just use the Perl to do the job straight away.

If you tell us more, or ask in the microsoft.public.win2000.cmdprompt.admin
group you will likely get more specific help.

We do want to help.

--
Herb Martin, MCSE, MVP
http://www.LearnQuick.Com
(phone on web site)



.



Relevant Pages

  • Thanks for the comments Jan. 25, 2006
    ... "shadow" operating system which is running behind Windows. ... Perl can then collect data from that program and do ... that by sending longer strings etc. to the Windows clipboard and then having ... SendKeysuse a Ctrl V command to paste the information to the text editor ...
    (comp.lang.perl.misc)
  • Re: executing from command line
    ... if fact it's a way to run a command remotely. ... >> I have a perl script that i would like to run it on a windows server. ... >opening up a security hole on the remote machine when you do this. ...
    (comp.lang.perl.misc)
  • Re: Windows error message
    ... > MS-DOS andMicrosoft Windows applications. ... Error message when you install or start an MS-DOS or 16-bit ... In the command prompt, type in the following two commands exactly as ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)
  • Re: SP2 &16 bit programs
    ... The system file is not suitable for running MS-DOS and MS Windows applications... ... WinXP SP2 and AVAST installed, ... In the command prompt, type in the following two commands exactly as ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsxp.general)
  • Re: perl in Windows: using the "Send To" folder and perl
    ... this is not strictly a Perl question but ... ... > marked are supplied on the command line to the executable i.e. ... > I create my executable by writing a .bat file which in turn supplies ... You do not mention which Windows command shell you are using. ...
    (comp.lang.perl.misc)