Unable to run vbscript file on windows 10











up vote
0
down vote

favorite












When I try to run a .vbs file on my Windows 10 laptop it shows the following error.



enter image description here










share|improve this question
























  • How did you try to run the file? Obviously there is a file a.vbs on the (?your?) Desktop.
    – LotPings
    Aug 1 '17 at 11:34










  • Make sure cscript.exe and wscript.exe present in System32 and/or in SysWOW64 folder.
    – Biswapriyo
    Aug 1 '17 at 12:26










  • Can you post the source code of this vbscript ?
    – Hackoo
    Aug 22 '17 at 3:44















up vote
0
down vote

favorite












When I try to run a .vbs file on my Windows 10 laptop it shows the following error.



enter image description here










share|improve this question
























  • How did you try to run the file? Obviously there is a file a.vbs on the (?your?) Desktop.
    – LotPings
    Aug 1 '17 at 11:34










  • Make sure cscript.exe and wscript.exe present in System32 and/or in SysWOW64 folder.
    – Biswapriyo
    Aug 1 '17 at 12:26










  • Can you post the source code of this vbscript ?
    – Hackoo
    Aug 22 '17 at 3:44













up vote
0
down vote

favorite









up vote
0
down vote

favorite











When I try to run a .vbs file on my Windows 10 laptop it shows the following error.



enter image description here










share|improve this question















When I try to run a .vbs file on my Windows 10 laptop it shows the following error.



enter image description here







windows-10 vbscript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 1 '17 at 10:22









jcbermu

15.5k24354




15.5k24354










asked Aug 1 '17 at 10:17









Swap

1111




1111












  • How did you try to run the file? Obviously there is a file a.vbs on the (?your?) Desktop.
    – LotPings
    Aug 1 '17 at 11:34










  • Make sure cscript.exe and wscript.exe present in System32 and/or in SysWOW64 folder.
    – Biswapriyo
    Aug 1 '17 at 12:26










  • Can you post the source code of this vbscript ?
    – Hackoo
    Aug 22 '17 at 3:44


















  • How did you try to run the file? Obviously there is a file a.vbs on the (?your?) Desktop.
    – LotPings
    Aug 1 '17 at 11:34










  • Make sure cscript.exe and wscript.exe present in System32 and/or in SysWOW64 folder.
    – Biswapriyo
    Aug 1 '17 at 12:26










  • Can you post the source code of this vbscript ?
    – Hackoo
    Aug 22 '17 at 3:44
















How did you try to run the file? Obviously there is a file a.vbs on the (?your?) Desktop.
– LotPings
Aug 1 '17 at 11:34




How did you try to run the file? Obviously there is a file a.vbs on the (?your?) Desktop.
– LotPings
Aug 1 '17 at 11:34












Make sure cscript.exe and wscript.exe present in System32 and/or in SysWOW64 folder.
– Biswapriyo
Aug 1 '17 at 12:26




Make sure cscript.exe and wscript.exe present in System32 and/or in SysWOW64 folder.
– Biswapriyo
Aug 1 '17 at 12:26












Can you post the source code of this vbscript ?
– Hackoo
Aug 22 '17 at 3:44




Can you post the source code of this vbscript ?
– Hackoo
Aug 22 '17 at 3:44










3 Answers
3






active

oldest

votes

















up vote
1
down vote













I can think of two reasons this might happen:




  1. The script is downloaded from the internet, so it is blocked. Unblock it via properties on the file.

  2. You have some sort of anti-malware installed that blocks access to the file. Check your logs for any information.






share|improve this answer




























    up vote
    0
    down vote













    EDIT



    Based on comment from Peter (thank you for that), I edit my answer.



    You probably either rights issue - you don't have rights to execute your script on your desktop or you maybe the scripting is blocked altogether? More information is needed from you - what kind of script is that? The best would be to provide the source code + what are the rights on the directory (or directory chain) where you try to execute your code.



    This is in case you need to elevate the rights of your script which is not yet your case:



    You have to have privileges to run your script. You can either start your command prompt as Administrator



    Or



    use runas /noprofile /user:mymachineadministrator your_script.vbs from your user command line



    Or



    Finally you can add UAC directly to your script:



    This is source code from Microsoft technet:



    '---------------------------------------
    'Elevate this script before invoking it.
    '25.2.2011 FNL
    '---------------------------------------
    bElevate = False
    if WScript.Arguments.Count > 0 Then If WScript.Arguments(WScript.Arguments.Count-1) <> "|" then bElevate = True
    if bElevate Or WScript.Arguments.Count = 0 Then ElevateUAC
    '******************
    'Your script goes here
    '******************


    '-----------------------------------------
    'Run this script under elevated privileges
    '-----------------------------------------
    Sub ElevateUAC
    sParms = " |"
    If WScript.Arguments.Count > 0 Then
    For i = WScript.Arguments.Count-1 To 0 Step -1
    sParms = " " & WScript.Arguments(i) & sParms
    Next
    End If
    Set oShell = CreateObject("Shell.Application")
    oShell.ShellExecute "wscript.exe", WScript.ScriptFullName & sParms, , "runas", 1
    WScript.Quit
    End Sub





    share|improve this answer























    • You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
      – Peter Hahndorf
      Aug 1 '17 at 11:51










    • @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
      – tukan
      Aug 1 '17 at 12:10


















    up vote
    0
    down vote













    Check to see if the file is on the "Public Desktop". If it is, it will appear
    on every user's visual "desktop", but Windows will fail to find it in the
    user Desktop folders.






    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%2f1236466%2funable-to-run-vbscript-file-on-windows-10%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
      1
      down vote













      I can think of two reasons this might happen:




      1. The script is downloaded from the internet, so it is blocked. Unblock it via properties on the file.

      2. You have some sort of anti-malware installed that blocks access to the file. Check your logs for any information.






      share|improve this answer

























        up vote
        1
        down vote













        I can think of two reasons this might happen:




        1. The script is downloaded from the internet, so it is blocked. Unblock it via properties on the file.

        2. You have some sort of anti-malware installed that blocks access to the file. Check your logs for any information.






        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          I can think of two reasons this might happen:




          1. The script is downloaded from the internet, so it is blocked. Unblock it via properties on the file.

          2. You have some sort of anti-malware installed that blocks access to the file. Check your logs for any information.






          share|improve this answer












          I can think of two reasons this might happen:




          1. The script is downloaded from the internet, so it is blocked. Unblock it via properties on the file.

          2. You have some sort of anti-malware installed that blocks access to the file. Check your logs for any information.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 1 '17 at 12:14









          Magnus

          1,505413




          1,505413
























              up vote
              0
              down vote













              EDIT



              Based on comment from Peter (thank you for that), I edit my answer.



              You probably either rights issue - you don't have rights to execute your script on your desktop or you maybe the scripting is blocked altogether? More information is needed from you - what kind of script is that? The best would be to provide the source code + what are the rights on the directory (or directory chain) where you try to execute your code.



              This is in case you need to elevate the rights of your script which is not yet your case:



              You have to have privileges to run your script. You can either start your command prompt as Administrator



              Or



              use runas /noprofile /user:mymachineadministrator your_script.vbs from your user command line



              Or



              Finally you can add UAC directly to your script:



              This is source code from Microsoft technet:



              '---------------------------------------
              'Elevate this script before invoking it.
              '25.2.2011 FNL
              '---------------------------------------
              bElevate = False
              if WScript.Arguments.Count > 0 Then If WScript.Arguments(WScript.Arguments.Count-1) <> "|" then bElevate = True
              if bElevate Or WScript.Arguments.Count = 0 Then ElevateUAC
              '******************
              'Your script goes here
              '******************


              '-----------------------------------------
              'Run this script under elevated privileges
              '-----------------------------------------
              Sub ElevateUAC
              sParms = " |"
              If WScript.Arguments.Count > 0 Then
              For i = WScript.Arguments.Count-1 To 0 Step -1
              sParms = " " & WScript.Arguments(i) & sParms
              Next
              End If
              Set oShell = CreateObject("Shell.Application")
              oShell.ShellExecute "wscript.exe", WScript.ScriptFullName & sParms, , "runas", 1
              WScript.Quit
              End Sub





              share|improve this answer























              • You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
                – Peter Hahndorf
                Aug 1 '17 at 11:51










              • @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
                – tukan
                Aug 1 '17 at 12:10















              up vote
              0
              down vote













              EDIT



              Based on comment from Peter (thank you for that), I edit my answer.



              You probably either rights issue - you don't have rights to execute your script on your desktop or you maybe the scripting is blocked altogether? More information is needed from you - what kind of script is that? The best would be to provide the source code + what are the rights on the directory (or directory chain) where you try to execute your code.



              This is in case you need to elevate the rights of your script which is not yet your case:



              You have to have privileges to run your script. You can either start your command prompt as Administrator



              Or



              use runas /noprofile /user:mymachineadministrator your_script.vbs from your user command line



              Or



              Finally you can add UAC directly to your script:



              This is source code from Microsoft technet:



              '---------------------------------------
              'Elevate this script before invoking it.
              '25.2.2011 FNL
              '---------------------------------------
              bElevate = False
              if WScript.Arguments.Count > 0 Then If WScript.Arguments(WScript.Arguments.Count-1) <> "|" then bElevate = True
              if bElevate Or WScript.Arguments.Count = 0 Then ElevateUAC
              '******************
              'Your script goes here
              '******************


              '-----------------------------------------
              'Run this script under elevated privileges
              '-----------------------------------------
              Sub ElevateUAC
              sParms = " |"
              If WScript.Arguments.Count > 0 Then
              For i = WScript.Arguments.Count-1 To 0 Step -1
              sParms = " " & WScript.Arguments(i) & sParms
              Next
              End If
              Set oShell = CreateObject("Shell.Application")
              oShell.ShellExecute "wscript.exe", WScript.ScriptFullName & sParms, , "runas", 1
              WScript.Quit
              End Sub





              share|improve this answer























              • You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
                – Peter Hahndorf
                Aug 1 '17 at 11:51










              • @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
                – tukan
                Aug 1 '17 at 12:10













              up vote
              0
              down vote










              up vote
              0
              down vote









              EDIT



              Based on comment from Peter (thank you for that), I edit my answer.



              You probably either rights issue - you don't have rights to execute your script on your desktop or you maybe the scripting is blocked altogether? More information is needed from you - what kind of script is that? The best would be to provide the source code + what are the rights on the directory (or directory chain) where you try to execute your code.



              This is in case you need to elevate the rights of your script which is not yet your case:



              You have to have privileges to run your script. You can either start your command prompt as Administrator



              Or



              use runas /noprofile /user:mymachineadministrator your_script.vbs from your user command line



              Or



              Finally you can add UAC directly to your script:



              This is source code from Microsoft technet:



              '---------------------------------------
              'Elevate this script before invoking it.
              '25.2.2011 FNL
              '---------------------------------------
              bElevate = False
              if WScript.Arguments.Count > 0 Then If WScript.Arguments(WScript.Arguments.Count-1) <> "|" then bElevate = True
              if bElevate Or WScript.Arguments.Count = 0 Then ElevateUAC
              '******************
              'Your script goes here
              '******************


              '-----------------------------------------
              'Run this script under elevated privileges
              '-----------------------------------------
              Sub ElevateUAC
              sParms = " |"
              If WScript.Arguments.Count > 0 Then
              For i = WScript.Arguments.Count-1 To 0 Step -1
              sParms = " " & WScript.Arguments(i) & sParms
              Next
              End If
              Set oShell = CreateObject("Shell.Application")
              oShell.ShellExecute "wscript.exe", WScript.ScriptFullName & sParms, , "runas", 1
              WScript.Quit
              End Sub





              share|improve this answer














              EDIT



              Based on comment from Peter (thank you for that), I edit my answer.



              You probably either rights issue - you don't have rights to execute your script on your desktop or you maybe the scripting is blocked altogether? More information is needed from you - what kind of script is that? The best would be to provide the source code + what are the rights on the directory (or directory chain) where you try to execute your code.



              This is in case you need to elevate the rights of your script which is not yet your case:



              You have to have privileges to run your script. You can either start your command prompt as Administrator



              Or



              use runas /noprofile /user:mymachineadministrator your_script.vbs from your user command line



              Or



              Finally you can add UAC directly to your script:



              This is source code from Microsoft technet:



              '---------------------------------------
              'Elevate this script before invoking it.
              '25.2.2011 FNL
              '---------------------------------------
              bElevate = False
              if WScript.Arguments.Count > 0 Then If WScript.Arguments(WScript.Arguments.Count-1) <> "|" then bElevate = True
              if bElevate Or WScript.Arguments.Count = 0 Then ElevateUAC
              '******************
              'Your script goes here
              '******************


              '-----------------------------------------
              'Run this script under elevated privileges
              '-----------------------------------------
              Sub ElevateUAC
              sParms = " |"
              If WScript.Arguments.Count > 0 Then
              For i = WScript.Arguments.Count-1 To 0 Step -1
              sParms = " " & WScript.Arguments(i) & sParms
              Next
              End If
              Set oShell = CreateObject("Shell.Application")
              oShell.ShellExecute "wscript.exe", WScript.ScriptFullName & sParms, , "runas", 1
              WScript.Quit
              End Sub






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 2 '17 at 6:43

























              answered Aug 1 '17 at 10:46









              tukan

              781213




              781213












              • You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
                – Peter Hahndorf
                Aug 1 '17 at 11:51










              • @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
                – tukan
                Aug 1 '17 at 12:10


















              • You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
                – Peter Hahndorf
                Aug 1 '17 at 11:51










              • @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
                – tukan
                Aug 1 '17 at 12:10
















              You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
              – Peter Hahndorf
              Aug 1 '17 at 11:51




              You don't have to be an administrator to run a vbs script, and the message would be very different. There may be certain things in the script that you can only perform in elevated mode, but at least the script would executing in the first place.
              – Peter Hahndorf
              Aug 1 '17 at 11:51












              @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
              – tukan
              Aug 1 '17 at 12:10




              @PeterHahndorf: you are right about the message would be different. Maybe user restriction? Nothing can be executed from desktop? The originator - could you try to run it from e.g. c:test (make that directory yourself)?
              – tukan
              Aug 1 '17 at 12:10










              up vote
              0
              down vote













              Check to see if the file is on the "Public Desktop". If it is, it will appear
              on every user's visual "desktop", but Windows will fail to find it in the
              user Desktop folders.






              share|improve this answer

























                up vote
                0
                down vote













                Check to see if the file is on the "Public Desktop". If it is, it will appear
                on every user's visual "desktop", but Windows will fail to find it in the
                user Desktop folders.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Check to see if the file is on the "Public Desktop". If it is, it will appear
                  on every user's visual "desktop", but Windows will fail to find it in the
                  user Desktop folders.






                  share|improve this answer












                  Check to see if the file is on the "Public Desktop". If it is, it will appear
                  on every user's visual "desktop", but Windows will fail to find it in the
                  user Desktop folders.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 1 at 3:14









                  kreemoweet

                  3,5621214




                  3,5621214






























                      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%2f1236466%2funable-to-run-vbscript-file-on-windows-10%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

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                      Eduardo VII do Reino Unido