Jump to content

.rdp files


Recommended Posts

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

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

Well 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

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

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

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

This works:

ShellExecute("mstsc.exe ",'"C:\Documents and Settings\path\Desktop\DT.rdp"')

note the single quotes

Yes 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

...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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...