A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Security and Administration with Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Batch Script works manually...not automatically



 
 
Thread Tools Display Modes
  #1  
Old October 15th 09, 10:06 PM posted to microsoft.public.windowsxp.security_admin
Sixstringr1981
external usenet poster
 
Posts: 2
Default Batch Script works manually...not automatically

Hi all,

I have several scripts working together for a common purpose...which is the
following: 1. to create a new, local account on a machine with Windows XP
Professional installed. 2. copy down some scripts from a network share to
the local machine. 3. add a registry entry to force a script to run for
every user at startup every time a user logs in.

I have accomplished this with a batch file deployed via GPO. Now here's the
problem: when I log into the local account and the script automatically
launches, the script only processes internal commands like network pings,
playing a wav file, etc). Anything external like launching a separate VB
Script or creating a log file cannot be done for some reason.

The real kicker is that the script works perfectly fine if you log into the
account and manually run the script yourself by double clicking on the batch
file. At first, I thought maybe it's because the automatically launched
script is being run by another account other than the current user account
(like SYSTEM or something). I then scripted a Runas command -- passing
appropriate credentials using the CPAU.exe tool. Even though it shows that
the appropriate user is running the script, the same behavior occurs. Can
anyone help me understand why this is happening?

Thank you very much

Jonathan
Ads
  #2  
Old October 18th 09, 08:55 AM posted to microsoft.public.windowsxp.security_admin
Anteaus
external usenet poster
 
Posts: 1,330
Default Batch Script works manually...not automatically


Most common reason for this sort of problem is a change of working directory
when the script is run as a system process instead of the user.

Have you included CD \{whatever} as the first line?

"Sixstringr1981" wrote:

Hi all,

I have several scripts working together for a common purpose...which is the
following: 1. to create a new, local account on a machine with Windows XP
Professional installed. 2. copy down some scripts from a network share to
the local machine. 3. add a registry entry to force a script to run for
every user at startup every time a user logs in.

I have accomplished this with a batch file deployed via GPO. Now here's the
problem: when I log into the local account and the script automatically
launches, the script only processes internal commands like network pings,
playing a wav file, etc). Anything external like launching a separate VB
Script or creating a log file cannot be done for some reason.

The real kicker is that the script works perfectly fine if you log into the
account and manually run the script yourself by double clicking on the batch
file. At first, I thought maybe it's because the automatically launched
script is being run by another account other than the current user account
(like SYSTEM or something). I then scripted a Runas command -- passing
appropriate credentials using the CPAU.exe tool. Even though it shows that
the appropriate user is running the script, the same behavior occurs. Can
anyone help me understand why this is happening?

Thank you very much

Jonathan

 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 11:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.