Product, version and build:
(*** Please do not write "latest" as a version, specify a version number ***)
32 or 64 bit version of product: 64
Operating system: W2K12R2
32 or 64 bit OS: 64
PowerShell Version:
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Hi,
I'd like to exectue an RDP file when pressing a button (it then opens an RDP session to a remote app).
Opening an exe the same way works by using & "$ToolsFolder\Myexe.exe" but the rdp gives following error:
The term 'C:\Myrdp.rdp' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again..Exception.Message at line 300
Please advise howto do this the proper way.
S.
Execute an RDP file in PS Studio?
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Execute an RDP file in PS Studio?
[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Execute an RDP file in PS Studio?
Use Start-Process:
start-process 'C:\Users\testuser\Desktop\omega.rdp'
stevens - you keep posting in the wrong forum. Devin moves your posts here for us. Try posting in "PowerShell GUIs' or "Windows PowerShell" under http://scriptinganswers.com
start-process 'C:\Users\testuser\Desktop\omega.rdp'
stevens - you keep posting in the wrong forum. Devin moves your posts here for us. Try posting in "PowerShell GUIs' or "Windows PowerShell" under http://scriptinganswers.com
Re: Execute an RDP file in PS Studio?
Sorry for that. I will pay attention to it.
Thanks for the feedback.
One more thing, executing locally (machine on which my PS Studio is installed) works, but exe on other machine, the rdp doesn't work. It says 'This command cannot be run due to the error: The system cannot find the file specified..Exception.'
Another button which also opens an executable on the same location does work fine. So I'm puzzled.
What surprises me is the invocation of the file, please see screenshot below. My path is \supporttool\tools\myrdp.rdp but it writes supportooltools WITHOUT the backslash.
Tried every possible combination but it doesn't show the \.
What am I doing wrong? Please advise.
Thanks for the feedback.
One more thing, executing locally (machine on which my PS Studio is installed) works, but exe on other machine, the rdp doesn't work. It says 'This command cannot be run due to the error: The system cannot find the file specified..Exception.'
Another button which also opens an executable on the same location does work fine. So I'm puzzled.
What surprises me is the invocation of the file, please see screenshot below. My path is \supporttool\tools\myrdp.rdp but it writes supportooltools WITHOUT the backslash.
Tried every possible combination but it doesn't show the \.
What am I doing wrong? Please advise.
Re: Execute an RDP file in PS Studio?
Please don't post screen shots. They are mostly unreadable in most browsers. Post a copy of the code.
I cannot understand what you are saying. The error message is clear. The file path you used doesn't exist.
I cannot understand what you are saying. The error message is clear. The file path you used doesn't exist.
Re: Execute an RDP file in PS Studio?
In the globals.ps1 of my project I set the following:
$ScriptPath = Split-Path $MyInvocation.MyCommand.path
$ToolsFolder = $ScriptPath + "\tools"
I got 3 buttons in the mainform.psf: 1 of the 3 works correctly, the others don't but have the exact same command type
Start-Process "$ToolsFolder\WindirStat.exe"
When I hover over $Toolsfolder it shows me ...\SupportToolstools as value for the variable and I cannot make it \SupportTools\Tools what the path should be.
However, the buttons = launching exes which are below the buttons work fine on the local machine (which has PS Studio installed) but not on a remote one and I cannot figure out why.
$ScriptPath = Split-Path $MyInvocation.MyCommand.path
$ToolsFolder = $ScriptPath + "\tools"
I got 3 buttons in the mainform.psf: 1 of the 3 works correctly, the others don't but have the exact same command type
Start-Process "$ToolsFolder\WindirStat.exe"
When I hover over $Toolsfolder it shows me ...\SupportToolstools as value for the variable and I cannot make it \SupportTools\Tools what the path should be.
However, the buttons = launching exes which are below the buttons work fine on the local machine (which has PS Studio installed) but not on a remote one and I cannot figure out why.