Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > run once script

Reply
Thread Tools Display Modes

run once script

 
 
James Brister
Guest
Posts: n/a

 
      01-21-2009
I have been searching around the internet and I can't find a consensus on
this topic. I have a batch file (.bat) that does a silent install of a
software program we use. I am able to run this batch file computer by
computer but, it will take forever. Since I have done a few computers with
the batch file, I know it works correctly. My question is in regards to GP.
Can I setup the batch file to be called one time per computer at either 1)
computer start up or 2) at logon?


 
Reply With Quote
 
 
 
 
David H. Lipman
Guest
Posts: n/a

 
      01-21-2009
From: "James Brister" <>

| I have been searching around the internet and I can't find a consensus on
| this topic. I have a batch file (.bat) that does a silent install of a
| software program we use. I am able to run this batch file computer by
| computer but, it will take forever. Since I have done a few computers with
| the batch file, I know it works correctly. My question is in regards to GP.
| Can I setup the batch file to be called one time per computer at either 1)
| computer start up or 2) at logon?


HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Once

--
Dave
http://www.claymania.com/removal-trojan-adware.html
Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp


 
Reply With Quote
 
James Brister
Guest
Posts: n/a

 
      01-21-2009
thanks for the info. I'll give it a shot. One follow up question to that.
Does it process with administrator rights or do I need to tell it to run as
the administrator? If so, how?



"David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message
news:...
> From: "James Brister" <>
>
> | I have been searching around the internet and I can't find a consensus
> on
> | this topic. I have a batch file (.bat) that does a silent install of a
> | software program we use. I am able to run this batch file computer by
> | computer but, it will take forever. Since I have done a few computers
> with
> | the batch file, I know it works correctly. My question is in regards to
> GP.
> | Can I setup the batch file to be called one time per computer at either
> 1)
> | computer start up or 2) at logon?
>
>
> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Once
>
> --
> Dave
> http://www.claymania.com/removal-trojan-adware.html
> Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp
>
>



 
Reply With Quote
 
David H. Lipman
Guest
Posts: n/a

 
      01-21-2009
From: "James Brister" <>

| thanks for the info. I'll give it a shot. One follow up question to that.
| Does it process with administrator rights or do I need to tell it to run as
| the administrator? If so, how?


I believe it runs under the context of the user.

--
Dave
http://www.claymania.com/removal-trojan-adware.html
Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp


 
Reply With Quote
 
James Brister
Guest
Posts: n/a

 
      01-21-2009
but if it's under the computer configuration portion of the GPO, it runs as
the computer which has essentally "admin rights"? Correct?


"David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message
news:%23v%...
> From: "James Brister" <>
>
> | thanks for the info. I'll give it a shot. One follow up question to
> that.
> | Does it process with administrator rights or do I need to tell it to run
> as
> | the administrator? If so, how?
>
>
> I believe it runs under the context of the user.
>
> --
> Dave
> http://www.claymania.com/removal-trojan-adware.html
> Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp
>
>



 
Reply With Quote
 
Al Dunbar
Guest
Posts: n/a

 
      01-21-2009

"James Brister" <> wrote in message
news:...
> but if it's under the computer configuration portion of the GPO, it runs
> as the computer which has essentally "admin rights"? Correct?


It's not running by any GPO, as the "run once" entries in the registry are
windows features, not domain features. Because of where this is located in
the registry:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Once

I would think that it runs under the credentials of "NT AUTHORITY\SYSTEM"
when windows starts up, and before anyone logs in.

/Al

> "David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message
> news:%23v%...
>> From: "James Brister" <>
>>
>> | thanks for the info. I'll give it a shot. One follow up question to
>> that.
>> | Does it process with administrator rights or do I need to tell it to
>> run as
>> | the administrator? If so, how?
>>
>>
>> I believe it runs under the context of the user.
>>
>> --
>> Dave
>> http://www.claymania.com/removal-trojan-adware.html
>> Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp
>>
>>

>
>



 
Reply With Quote
 
Stefan Kanthak
Guest
Posts: n/a

 
      01-21-2009
"Al Dunbar" <> wrote:

> "James Brister" <> wrote in message
> news:...
>> but if it's under the computer configuration portion of the GPO, it runs
>> as the computer which has essentally "admin rights"? Correct?

>
> It's not running by any GPO, as the "run once" entries in the registry are
> windows features, not domain features. Because of where this is located in
> the registry:
>
> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Once
>
> I would think that it runs under the credentials of "NT AUTHORITY\SYSTEM"
> when windows starts up, and before anyone logs in.


No!
1. All "Run" and "RunOnce" entries are evaluated at login and
2. run with the credentials of the user logging in.

Only machine startup scripts, scheduled tasks or services are run at
startup.

Stefan

 
Reply With Quote
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      01-21-2009
James Brister wrote:

>I have been searching around the internet and I can't find a consensus on
>this topic. I have a batch file (.bat) that does a silent install of a
>software program we use. I am able to run this batch file computer by
>computer but, it will take forever. Since I have done a few computers with
>the batch file, I know it works correctly. My question is in regards to
>GP. Can I setup the batch file to be called one time per computer at either
>1) computer start up or 2) at logon?


If the batch file installs something for the users, and can be run by the
users (they have sufficient permissions), it can be run as a logon script.
Otherwise it should be run as a startup script. Logon script run with the
permissions of the user. Startup scripts run with system permissions on the
local computer, and with the permissions of the computer object elsewhere in
the domain.

In either case you can design the script to run once; once per user for
logon scripts, once per computer for startup scripts. The script can check
for the existence of a file or registry setting, for example, that only
exists if the script has already been run. I like to use "flag" files saved
on a network share, so that I can monitor progress remotely and tell when
the code is no longer required. A batch file can easily create such a file
when it completes. If the file is saved in a network share it should be
uniquely named after the computer/user.

Another option (if the deployment is to each computer rather than each user)
is to install remotely yourself. If the batch file runs silently with no
user intervention (and no messages), you can use WMI to deploy it remotely.
The routine to deploy can either loop through a text file of computer names,
or loop through the computer members of a group. I have an example VBScript
program that does this linked here:

http://www.rlmueller.net/Deploy.htm

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


 
Reply With Quote
 
Al Dunbar
Guest
Posts: n/a

 
      01-21-2009

"Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
news:...
> "Al Dunbar" <> wrote:
>
>> "James Brister" <> wrote in message
>> news:...
>>> but if it's under the computer configuration portion of the GPO, it runs
>>> as the computer which has essentally "admin rights"? Correct?

>>
>> It's not running by any GPO, as the "run once" entries in the registry
>> are
>> windows features, not domain features. Because of where this is located
>> in
>> the registry:
>>
>> HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Once
>>
>> I would think that it runs under the credentials of "NT AUTHORITY\SYSTEM"
>> when windows starts up, and before anyone logs in.

>
> No!
> 1. All "Run" and "RunOnce" entries are evaluated at login and
> 2. run with the credentials of the user logging in.


Oops, guessed wrong, my bad.

> Only machine startup scripts, scheduled tasks or services are run at
> startup.


Thanks for straightening me out on these details.

/Al


> Stefan
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run a WSH script as a startup script &| from command line Ehren Active Directory 0 10-03-2007 07:19 PM
Script from Script repository gives 0x80041021 error Jayant Sane Scripting 0 04-11-2006 09:54 PM
[MSH] - Is it possible to combine functions into a script/library file that can later be included into another script? Rahul Agarwal Scripting 1 12-05-2005 11:30 PM
Re: How to I Kill - Reset Idle Terminal / Remote Session thru VB Script or Batch Script on Windows 2000/2003 Chris King Scripting 0 07-07-2004 03:35 PM
Script Help Needed! Installing via Script when user does not have Admin Rights!!! Greg H Scripting 0 08-14-2003 01:41 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59