Button that runs PowerShell script

Forums Desktop Info Button that runs PowerShell script

Tagged: ,

Viewing 2 reply threads
  • Author
    Posts
    • #3622
      AvatarVS
      Participant

      Hello!

      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.

      0
    • #3623
      GlennGlenn
      Keymaster

      post your script

      0
    • #3630
      AvatarVS
      Participant

      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”)

      0
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!