dcop Posted May 27, 2007 Share Posted May 27, 2007 ShellExecute("C:\Documents and Settings\laptop\My Documents\desk2.rdp") It fires up fine clicking with a mouse, pasting C:\Documents and Settings\laptop\My Documents\desk2.rdp into start|run|ok or on the command line. But when the above code in a Autoit script it say the file isnt associated with a program, but it is or it wouldnt launch from a mouse click. TIA, Dennis Link to comment Share on other sites More sharing options...
dcop Posted May 27, 2007 Author Share Posted May 27, 2007 ShellExecute("C:\Documents and Settings\laptop\My Documents\desk2.rdp")It fires up fine clicking with a mouse, pasting C:\Documents and Settings\laptop\My Documents\desk2.rdp into start|run|ok or on the command line. But when the above code in a Autoit script it say the file isnt associated with a program, but it is or it wouldnt launch from a mouse click.TIA, DennisWell alls I been able to figure out so far is that I can ShellExecute("mstsc") and get the Remote Desktop witht he drop down menu. But I'd rather be able to just shellexecute the .rdp file. Anyone? Link to comment Share on other sites More sharing options...
tAKTelapis Posted May 28, 2007 Share Posted May 28, 2007 run("mstsc.exe c:\test.rdp") Try that instead. Runs fine on my XP Pro install. Link to comment Share on other sites More sharing options...
dcop Posted May 28, 2007 Author Share Posted May 28, 2007 run("mstsc.exe c:\test.rdp")Try that instead. Runs fine on my XP Pro install.No luck. Weird cause I'm running XP Pro also. It's a windows thing tho I'm pretty sure. The thing is why would it work from start|run but not shellexecute. I thought they were exactly the same thing. Link to comment Share on other sites More sharing options...
tAKTelapis Posted May 28, 2007 Share Posted May 28, 2007 They essentially are. What happens when you double click on a .rdp file? does it open? i find it hard to believe that using what i posted does not work. Mstsc.exe is located in the system path, in the event it is not, try this instead: $RDPFile = "INSERT PATH TO RDP HERE" run("c:\windows\system32\mstsc.exe "&$RDPFile) Give that a go Link to comment Share on other sites More sharing options...
dcop Posted May 28, 2007 Author Share Posted May 28, 2007 They essentially are. What happens when you double click on a .rdp file? does it open? i find it hard to believe that using what i posted does not work. Mstsc.exe is located in the system path, in the event it is not, try this instead: $RDPFile = "INSERT PATH TO RDP HERE" run("c:\windows\system32\mstsc.exe "&$RDPFile) Give that a go Yup it does open fine on a double click. But not on your run statement or mine. Very strange. Link to comment Share on other sites More sharing options...
herewasplato Posted May 28, 2007 Share Posted May 28, 2007 This works:ShellExecute("mstsc.exe ",'"C:\Documents and Settings\path\Desktop\DT.rdp"')note the single quotes [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
dcop Posted May 28, 2007 Author Share Posted May 28, 2007 This works:ShellExecute("mstsc.exe ",'"C:\Documents and Settings\path\Desktop\DT.rdp"')note the single quotesYes it does! Thanx. I dont understand the reasoning as to why just the path in the start|run will work but not the way I had it before. Oh well, I cant have everything!thanks again... Link to comment Share on other sites More sharing options...
herewasplato Posted May 28, 2007 Share Posted May 28, 2007 (edited) ...I dont understand the reasoning as to why...I ain't gotta clue.Perhaps it always wraps paths in quotes before sending them on to the OS....enjoy AutoIt... Edited May 28, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
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