sloppyjoe72 Posted April 20, 2007 Posted April 20, 2007 Hello all, I've started writing a script to help manage the remote desktop connections we make a work a little easier. I'm starting out the script small, but hoping to learn enough to make it somewhat advanced. For now, I'm having an issue. Here's the script: $svrip = InputBox ("Question", "Enter the IP of the server") Run("mstsc.exe /V:") Exit The first line asks for the IP address of the server (which I hope to later be able to select from a list). In the second line, mstsc is the executable for remote desktop. the /V: command is supposed to be followed by the IP address of the server. My issue is I don't know how to pass along that info. I've tried Run("mstsc.exe /V:$svrip"), but it doesn't seem to like that. I've also tried Run("mstsc.exe /V:")$svrip, but it doesn't like that either. How can I pass along the IP address to the switch for the remote desktop connection? TIA Sloppy
martin Posted April 20, 2007 Posted April 20, 2007 Hello all, I've started writing a script to help manage the remote desktop connections we make a work a little easier. I'm starting out the script small, but hoping to learn enough to make it somewhat advanced. For now, I'm having an issue. Here's the script: $svrip = InputBox ("Question", "Enter the IP of the server") Run("mstsc.exe /V:") Exit The first line asks for the IP address of the server (which I hope to later be able to select from a list). In the second line, mstsc is the executable for remote desktop. the /V: command is supposed to be followed by the IP address of the server. My issue is I don't know how to pass along that info. I've tried Run("mstsc.exe /V:$svrip"), but it doesn't seem to like that. I've also tried Run("mstsc.exe /V:")$svrip, but it doesn't like that either. How can I pass along the IP address to the switch for the remote desktop connection? TIA Sloppy Run("mstsc.exe /V:" & $svrip) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
AutoItKing Posted April 20, 2007 Posted April 20, 2007 Read the help file before posting. It's right there!!! http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
sloppyjoe72 Posted April 25, 2007 Author Posted April 25, 2007 Read the help file before posting. It's right there!!!I tried looking but couldn't find it. So that I know for future reference, where is it located in the help file?
PsaltyDS Posted April 25, 2007 Posted April 25, 2007 I tried looking but couldn't find it. So that I know for future reference, where is it located in the help file?You should read the section on operators, strings, and variables. The problem is not how to use Run(), but how to assemble the string. The part you were missing was how to use '&' to put a literal string and a variable together. It won't take long with using Run() before you are going to want to include literal single and double quotes in the command line you are passing. A good grip on how to assemble string variables will serve you well. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now