Button that runs PowerShell script

Forums Desktop Info Button that runs PowerShell script

Tagged: ,

  • This topic has 2 replies, 2 voices, and was last updated 2 years ago by VSVS.
Viewing 2 reply threads
  • Author
    • #3622


      Thanks for a really cool app!
      I’m trying to create a button that launch powershell script which mapping network drives.
      Script itself working without any troubles, but i can’t associate it with the button – it’s just not running the script. “Set-ExecutionPolicy RemoteSigned -Scope CurrentUser” is typed in the script.

      Eventualy i ran script by button, but first it runs bat-file which runs vbs-file which run powershell script i needed. But it doesn’t seem nice-)

      So i will be very grateful it someone can share a solution or any thoughts what to put in button in ini file.

    • #3623

      post your script

    • #3630

      Hello Glenn!

      Please see below. For now i changed the process – button runs vns script which runs PS script – it works fine.
      Thanks for help!

      Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

      $drive = New-Object -ComObject WScript.Network
      $drive.MapNetworkDrive( “Z:”, “\\servrename\Users\$env:username”, “true”)
      $drive.MapNetworkDrive( “p:”, “\\servrename\Outlook_Archive$\$env:username”, “true”)
      $drive.MapNetworkDrive( “S:”, “\\servrename”, “true”)

Viewing 2 reply threads
  • The topic ‘Button that runs PowerShell script’ is closed to new replies.
Glenn's Page