Local group policy logon startup script not executing











up vote
0
down vote

favorite
1












This is for Windows 7



I have a .bat and .vbs file in a folder. The .bat runs the .vbs script. In the Local Policy Group editor, under Windows Settings/Scripts I added a reference to the .bat file in the Startup properties.



It seems as if my script is not running (I don’t see the result). Is there a log I can check to see why my script is not running? Do the .vbs and/or bat need to be in a special folder or anything? The .bat references the .vbs with a relative path - is that OK when being run as a startup script? Everything works fine when I just double-click to run the .bat file manually.










share|improve this question
























  • Are you running this script on your own box? A while ago during the course of regular development at work I changed the default file handler for .vbs files from the normal scripting host to notepad++ so I could edit them. Upon the next login, I was greeted by all of our domain's scripts popping up in notepad++. Lesson learned: make sure you aren't making any assumptions about the file associations for your .bat and .vbs scripts. Just a thought.
    – Fopedush
    Jan 22 '13 at 22:36










  • Why overcomplicate things with a BAT and a VBS. Do everything in the VBS.
    – Keltari
    Oct 6 '14 at 21:01















up vote
0
down vote

favorite
1












This is for Windows 7



I have a .bat and .vbs file in a folder. The .bat runs the .vbs script. In the Local Policy Group editor, under Windows Settings/Scripts I added a reference to the .bat file in the Startup properties.



It seems as if my script is not running (I don’t see the result). Is there a log I can check to see why my script is not running? Do the .vbs and/or bat need to be in a special folder or anything? The .bat references the .vbs with a relative path - is that OK when being run as a startup script? Everything works fine when I just double-click to run the .bat file manually.










share|improve this question
























  • Are you running this script on your own box? A while ago during the course of regular development at work I changed the default file handler for .vbs files from the normal scripting host to notepad++ so I could edit them. Upon the next login, I was greeted by all of our domain's scripts popping up in notepad++. Lesson learned: make sure you aren't making any assumptions about the file associations for your .bat and .vbs scripts. Just a thought.
    – Fopedush
    Jan 22 '13 at 22:36










  • Why overcomplicate things with a BAT and a VBS. Do everything in the VBS.
    – Keltari
    Oct 6 '14 at 21:01













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





This is for Windows 7



I have a .bat and .vbs file in a folder. The .bat runs the .vbs script. In the Local Policy Group editor, under Windows Settings/Scripts I added a reference to the .bat file in the Startup properties.



It seems as if my script is not running (I don’t see the result). Is there a log I can check to see why my script is not running? Do the .vbs and/or bat need to be in a special folder or anything? The .bat references the .vbs with a relative path - is that OK when being run as a startup script? Everything works fine when I just double-click to run the .bat file manually.










share|improve this question















This is for Windows 7



I have a .bat and .vbs file in a folder. The .bat runs the .vbs script. In the Local Policy Group editor, under Windows Settings/Scripts I added a reference to the .bat file in the Startup properties.



It seems as if my script is not running (I don’t see the result). Is there a log I can check to see why my script is not running? Do the .vbs and/or bat need to be in a special folder or anything? The .bat references the .vbs with a relative path - is that OK when being run as a startup script? Everything works fine when I just double-click to run the .bat file manually.







windows-7 script boot group-policy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 22 '13 at 23:04









Guy Thomas

2,57292846




2,57292846










asked Jan 22 '13 at 19:52









Derek

40011026




40011026












  • Are you running this script on your own box? A while ago during the course of regular development at work I changed the default file handler for .vbs files from the normal scripting host to notepad++ so I could edit them. Upon the next login, I was greeted by all of our domain's scripts popping up in notepad++. Lesson learned: make sure you aren't making any assumptions about the file associations for your .bat and .vbs scripts. Just a thought.
    – Fopedush
    Jan 22 '13 at 22:36










  • Why overcomplicate things with a BAT and a VBS. Do everything in the VBS.
    – Keltari
    Oct 6 '14 at 21:01


















  • Are you running this script on your own box? A while ago during the course of regular development at work I changed the default file handler for .vbs files from the normal scripting host to notepad++ so I could edit them. Upon the next login, I was greeted by all of our domain's scripts popping up in notepad++. Lesson learned: make sure you aren't making any assumptions about the file associations for your .bat and .vbs scripts. Just a thought.
    – Fopedush
    Jan 22 '13 at 22:36










  • Why overcomplicate things with a BAT and a VBS. Do everything in the VBS.
    – Keltari
    Oct 6 '14 at 21:01
















Are you running this script on your own box? A while ago during the course of regular development at work I changed the default file handler for .vbs files from the normal scripting host to notepad++ so I could edit them. Upon the next login, I was greeted by all of our domain's scripts popping up in notepad++. Lesson learned: make sure you aren't making any assumptions about the file associations for your .bat and .vbs scripts. Just a thought.
– Fopedush
Jan 22 '13 at 22:36




Are you running this script on your own box? A while ago during the course of regular development at work I changed the default file handler for .vbs files from the normal scripting host to notepad++ so I could edit them. Upon the next login, I was greeted by all of our domain's scripts popping up in notepad++. Lesson learned: make sure you aren't making any assumptions about the file associations for your .bat and .vbs scripts. Just a thought.
– Fopedush
Jan 22 '13 at 22:36












Why overcomplicate things with a BAT and a VBS. Do everything in the VBS.
– Keltari
Oct 6 '14 at 21:01




Why overcomplicate things with a BAT and a VBS. Do everything in the VBS.
– Keltari
Oct 6 '14 at 21:01










3 Answers
3






active

oldest

votes

















up vote
0
down vote













I can confirm that my .bat files works, even though it's on by D:scripts folder. May I suggest put a simple command such as 'Notepad' in the batch file, just to see if it works.



May I also suggest that fire up Task Manager to see what process are are active, for example with your original script, are there any .vbs entries amongst the processes?



One more thought, are you configuring the scripts under User ConfigurationWindows SettingsScripts(LogonLogoff) (my preference), or under Computer Configuration, which can be tricky.






share|improve this answer























  • I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
    – Derek
    Jan 22 '13 at 22:45


















up vote
0
down vote













Well this is a common error.



When you have a bat or powershell file, you need to move the script into the folder that you get when you click the "SHOW FILES", by moving the scripts there you are pretty sure that the system has all the required permissions to run at startup.



In my case it is: C:WINDOWSSystem32GroupPolicyMachineScriptsStartup






share|improve this answer






























    up vote
    0
    down vote













    First of all make sure that the policy is applied by runnin rsop from command prompt on the computer.



    Second of all make sure that the script is accessible from a shared folder that the policy would read from it.



    Not to mention some policies requires a restart even after a gpupdate /force . If it's placed under user configuration and you're applying it on a OU of computers make sure loopback processing mode is set to merged.



    What I suspect that there's an issue with the batch file calling the vbs file I would recommend the following:



    Run a command prompt and try to call the file manually one time from elevated cmd and another time from normal cmd, and it really depends on the methods you're trying to call the vbs file with either it is cscript or wscript now not to mention that some of those batch files are best to be configured as logon scripts under user settings and not computer (which I prefer).



    Now try to edit the batch file that calls the script by the following :



    @echo off

    %WINDIR%SysWOW64cmd.exe

    cscript script.vbs or \pathscript.vbs


    I think it's better to store the script in the Sysvol share. Or you can simply add the vbs script into the login script. Also if you paste the content of the batch file it would be easier to diagnose what's going on.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f540119%2flocal-group-policy-logon-startup-script-not-executing%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      0
      down vote













      I can confirm that my .bat files works, even though it's on by D:scripts folder. May I suggest put a simple command such as 'Notepad' in the batch file, just to see if it works.



      May I also suggest that fire up Task Manager to see what process are are active, for example with your original script, are there any .vbs entries amongst the processes?



      One more thought, are you configuring the scripts under User ConfigurationWindows SettingsScripts(LogonLogoff) (my preference), or under Computer Configuration, which can be tricky.






      share|improve this answer























      • I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
        – Derek
        Jan 22 '13 at 22:45















      up vote
      0
      down vote













      I can confirm that my .bat files works, even though it's on by D:scripts folder. May I suggest put a simple command such as 'Notepad' in the batch file, just to see if it works.



      May I also suggest that fire up Task Manager to see what process are are active, for example with your original script, are there any .vbs entries amongst the processes?



      One more thought, are you configuring the scripts under User ConfigurationWindows SettingsScripts(LogonLogoff) (my preference), or under Computer Configuration, which can be tricky.






      share|improve this answer























      • I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
        – Derek
        Jan 22 '13 at 22:45













      up vote
      0
      down vote










      up vote
      0
      down vote









      I can confirm that my .bat files works, even though it's on by D:scripts folder. May I suggest put a simple command such as 'Notepad' in the batch file, just to see if it works.



      May I also suggest that fire up Task Manager to see what process are are active, for example with your original script, are there any .vbs entries amongst the processes?



      One more thought, are you configuring the scripts under User ConfigurationWindows SettingsScripts(LogonLogoff) (my preference), or under Computer Configuration, which can be tricky.






      share|improve this answer














      I can confirm that my .bat files works, even though it's on by D:scripts folder. May I suggest put a simple command such as 'Notepad' in the batch file, just to see if it works.



      May I also suggest that fire up Task Manager to see what process are are active, for example with your original script, are there any .vbs entries amongst the processes?



      One more thought, are you configuring the scripts under User ConfigurationWindows SettingsScripts(LogonLogoff) (my preference), or under Computer Configuration, which can be tricky.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 22 '13 at 22:36

























      answered Jan 22 '13 at 22:29









      Guy Thomas

      2,57292846




      2,57292846












      • I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
        – Derek
        Jan 22 '13 at 22:45


















      • I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
        – Derek
        Jan 22 '13 at 22:45
















      I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
      – Derek
      Jan 22 '13 at 22:45




      I had them under Computer Configuration. I will try makinga simple case just to confirm it is running. It is not a long running process so its hard to see it in task man
      – Derek
      Jan 22 '13 at 22:45












      up vote
      0
      down vote













      Well this is a common error.



      When you have a bat or powershell file, you need to move the script into the folder that you get when you click the "SHOW FILES", by moving the scripts there you are pretty sure that the system has all the required permissions to run at startup.



      In my case it is: C:WINDOWSSystem32GroupPolicyMachineScriptsStartup






      share|improve this answer



























        up vote
        0
        down vote













        Well this is a common error.



        When you have a bat or powershell file, you need to move the script into the folder that you get when you click the "SHOW FILES", by moving the scripts there you are pretty sure that the system has all the required permissions to run at startup.



        In my case it is: C:WINDOWSSystem32GroupPolicyMachineScriptsStartup






        share|improve this answer

























          up vote
          0
          down vote










          up vote
          0
          down vote









          Well this is a common error.



          When you have a bat or powershell file, you need to move the script into the folder that you get when you click the "SHOW FILES", by moving the scripts there you are pretty sure that the system has all the required permissions to run at startup.



          In my case it is: C:WINDOWSSystem32GroupPolicyMachineScriptsStartup






          share|improve this answer














          Well this is a common error.



          When you have a bat or powershell file, you need to move the script into the folder that you get when you click the "SHOW FILES", by moving the scripts there you are pretty sure that the system has all the required permissions to run at startup.



          In my case it is: C:WINDOWSSystem32GroupPolicyMachineScriptsStartup







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 5 '16 at 4:27

























          answered Apr 5 '16 at 3:25









          Jose Ortega

          1214




          1214






















              up vote
              0
              down vote













              First of all make sure that the policy is applied by runnin rsop from command prompt on the computer.



              Second of all make sure that the script is accessible from a shared folder that the policy would read from it.



              Not to mention some policies requires a restart even after a gpupdate /force . If it's placed under user configuration and you're applying it on a OU of computers make sure loopback processing mode is set to merged.



              What I suspect that there's an issue with the batch file calling the vbs file I would recommend the following:



              Run a command prompt and try to call the file manually one time from elevated cmd and another time from normal cmd, and it really depends on the methods you're trying to call the vbs file with either it is cscript or wscript now not to mention that some of those batch files are best to be configured as logon scripts under user settings and not computer (which I prefer).



              Now try to edit the batch file that calls the script by the following :



              @echo off

              %WINDIR%SysWOW64cmd.exe

              cscript script.vbs or \pathscript.vbs


              I think it's better to store the script in the Sysvol share. Or you can simply add the vbs script into the login script. Also if you paste the content of the batch file it would be easier to diagnose what's going on.






              share|improve this answer



























                up vote
                0
                down vote













                First of all make sure that the policy is applied by runnin rsop from command prompt on the computer.



                Second of all make sure that the script is accessible from a shared folder that the policy would read from it.



                Not to mention some policies requires a restart even after a gpupdate /force . If it's placed under user configuration and you're applying it on a OU of computers make sure loopback processing mode is set to merged.



                What I suspect that there's an issue with the batch file calling the vbs file I would recommend the following:



                Run a command prompt and try to call the file manually one time from elevated cmd and another time from normal cmd, and it really depends on the methods you're trying to call the vbs file with either it is cscript or wscript now not to mention that some of those batch files are best to be configured as logon scripts under user settings and not computer (which I prefer).



                Now try to edit the batch file that calls the script by the following :



                @echo off

                %WINDIR%SysWOW64cmd.exe

                cscript script.vbs or \pathscript.vbs


                I think it's better to store the script in the Sysvol share. Or you can simply add the vbs script into the login script. Also if you paste the content of the batch file it would be easier to diagnose what's going on.






                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  First of all make sure that the policy is applied by runnin rsop from command prompt on the computer.



                  Second of all make sure that the script is accessible from a shared folder that the policy would read from it.



                  Not to mention some policies requires a restart even after a gpupdate /force . If it's placed under user configuration and you're applying it on a OU of computers make sure loopback processing mode is set to merged.



                  What I suspect that there's an issue with the batch file calling the vbs file I would recommend the following:



                  Run a command prompt and try to call the file manually one time from elevated cmd and another time from normal cmd, and it really depends on the methods you're trying to call the vbs file with either it is cscript or wscript now not to mention that some of those batch files are best to be configured as logon scripts under user settings and not computer (which I prefer).



                  Now try to edit the batch file that calls the script by the following :



                  @echo off

                  %WINDIR%SysWOW64cmd.exe

                  cscript script.vbs or \pathscript.vbs


                  I think it's better to store the script in the Sysvol share. Or you can simply add the vbs script into the login script. Also if you paste the content of the batch file it would be easier to diagnose what's going on.






                  share|improve this answer














                  First of all make sure that the policy is applied by runnin rsop from command prompt on the computer.



                  Second of all make sure that the script is accessible from a shared folder that the policy would read from it.



                  Not to mention some policies requires a restart even after a gpupdate /force . If it's placed under user configuration and you're applying it on a OU of computers make sure loopback processing mode is set to merged.



                  What I suspect that there's an issue with the batch file calling the vbs file I would recommend the following:



                  Run a command prompt and try to call the file manually one time from elevated cmd and another time from normal cmd, and it really depends on the methods you're trying to call the vbs file with either it is cscript or wscript now not to mention that some of those batch files are best to be configured as logon scripts under user settings and not computer (which I prefer).



                  Now try to edit the batch file that calls the script by the following :



                  @echo off

                  %WINDIR%SysWOW64cmd.exe

                  cscript script.vbs or \pathscript.vbs


                  I think it's better to store the script in the Sysvol share. Or you can simply add the vbs script into the login script. Also if you paste the content of the batch file it would be easier to diagnose what's going on.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 14 '16 at 21:21









                  nKn

                  4,47552230




                  4,47552230










                  answered Dec 14 '16 at 20:46









                  Elie

                  480111




                  480111






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f540119%2flocal-group-policy-logon-startup-script-not-executing%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                      Alcedinidae

                      RAC Tourist Trophy