Link to home
Start Free TrialLog in
Avatar of altonyoung
altonyoung

asked on

command won't run from my logon script

I created a Logon Script policy for an OU.  The script checks users' environment and call  a few batch files to update software/settings if needed.  The script ran perfectly OK from Windows Explorer.  However, it won't run the last batch file once I try it from the Logon Script policy.  Is there a limit on how many batch files can be nested and called from a logon script?   What is the best way to resovle this problem?  Thank you.



Avatar of Yogalingam
Yogalingam

As of such there is no limits for adding scripts but if your script works fine. kindly try to readd the script files.
If you require some help on how to add the batch files/scripts to GP
http://www.serverwatch.com/tutorials/article.php/1474241
Make sure that your batch file is not returning a screen or some for of output that you are not handling properly.

Also, make sure that the script/batch being executed is located in a place where the users can read it. If you run it interactively with your credentials, does it work? if you run it interactively with someone else's credentials (not a person with admin rights, that will spoil the fun) does it work?

Avatar of altonyoung

ASKER

Yogalingam,

I did try readding the script a few times.  Same result.

Eaperezh,

I ran the same script interactively as a regular user, not an administrator, it ran fine.  I only had trouble with the last line of code in a batch file that was called from the script.  There's nothing in my scirpt that would require user interaction.  

Any more ideas?   Thank you all for the support.  

 
when you say it wont run the last batch file, what is the difference with the previously called batch files? Do you re-initialize some variables as to not allow a mixup?
Is this batch being called the same way as the others?
I do not set or re-initialize any variables in my batch files.   Here is what I tried in the batch file:

Test 1:
Step 1.  run the program setup.exe
Step 2.  run update.exe for the program
Step 3.  run the batch file to set up user environment such as user defined views, registry keys, etc.

Test 2:
Step 1:  run the program setup.exe
Step 2: run the batch file to setup user envrionment
Step 3: run the update.exe for the program

In both tests, step 3 wouldn't run.  




 

I thought I would let you guys know what I found out:  I use sleep.exe in my batch file to wait for the previous process to finish before continue on to process the next command.  My original setting was to wait for 2.5 minutes.  Once I shorten the waiting time for sleep.exe to 1.5 minute, problem sovled.  Is there a time limit for logon scripts?   Thank you.  

ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial