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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|