Group Policy Logon Bat Script

1.6k views Asked by At

I have a simple .bat script triggered on user login to create a uniform work environment (load items to public desktop) as well as a few other small tasks - all are successful.

At the end of this script, I would like to call an additional .bat script and also open a system root folder if criteria is met. This however never occurs. The script I am calling begins with user prompt, and I notice scripts running as group policy do not always open a cmd window etc.

REM --------------------------------------------------
REM -----Update Newest Box & Scales / Uber Script-----
REM --------------------------------------------------

:BOXSCALE
if exist C:\scalescripts\Scale_Box_v3_Script.bat goto UBER
echo -
echo -
echo Scale_Box script is not up to date, please follow directions
call \\ant\fc\Dept\Photo\SDF8\SDF8_JW\scripts\Scale_Box_Uploader_v3\Scale_Box_v3_Uploader_Installer.bat

:UBER
if exist D:\Uber_Share_v2\Uber_Share_v2.bat goto END
echo -
echo -
echo Uber Share script is not up to date, please run installer as ADMIN
%SystemRoot%\explorer.exe "\\ant\fc\Dept\Photo\SDF8\Studio\Tech\scripts\Uber_Share_v2"

Pause

:END
Exit

The first bit (:BOXSCALE) is intended to launch a secondary script that contains mostly robocopy commands. It does require user interaction at the first bit. The second simply opens a server path in windows explorer for user. I am afraid that the user interaction is the problem as the start up script isn't visible to user when launched via GP Logon.

If I run this script manually, I receive the prompt from the first script and the system root opens as intended, but not if it is run via group policy login. I have also tried inputting the last two commands into a separate script and calling that, which also fails. Any ideas to get these last few items to run?

1

There are 1 answers

0
Garrett On BEST ANSWER

I found the solution to the problem. As suggested, it was the fact that the .bat script I was calling contained a user prompt. As the GP Logon script runs in the back ground, the user is unable to acknowledge prompt leaving the script hanging.