Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to pass command-line arguments to a program that is invoked via a file:// url?

I'm trying to include Remote Desktop links in a wiki page that lists some servers:

<a href="file:///c|/windows/system32/mstsc.exe /v:serverName">serverName</a>

When I omit the argument the link works fine, but when I include it the link doesn't work. I Googled around a bit and couldn't find any references to this. I suspect that the answer is that file:// urls simple don't accept arguments (I can think of all kinds of ways to abuse them if they do), but I thought I'd throw it out there in case I've simply got the syntax wrong.

Thanks.

share|improve this question

2 Answers 2

What I've seen other tools do is provide a *.rdp file you download and invoke. If you can attach these files to your wiki page, it's a pretty simple format. Here's a sample:

screen mode id:i:2
use multimon:i:0
desktopwidth:i:1366
desktopheight:i:768
session bpp:i:32
winposstr:s:0,1,0,0,1366,728
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:2
displayconnectionbar:i:1
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:**SERVERNAMEHERE**
audiomode:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:1
redirectclipboard:i:1
redirectposdevices:i:0
redirectdirectx:i:1
autoreconnection enabled:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:1
use redirection server name:i:0
drivestoredirect:s:
share|improve this answer
    
Interesting...I'm not sure if I'll use that in this particular situation, but it does give me some ideas. I hadn't realized that rdp files were just text. Thanks :) –  Cory Grimster Mar 1 '11 at 15:37

Unfortunately that's not the way the common gateway interface (CGI) works.

There are 3 methods of passing parameters to a script - GET (filename.ext?param1=foo&param2=bar), POST (data is read by the standard input of the script) and PATHINFO (filename.exe/val1/val2/val3)

None of these are even remotely like command line arguements.

Your best bet would probably to be to set up short cuts to the commands you want to run including their command line parameters and linking to those shortcuts.

share|improve this answer
    
CGI only applies to requests made with the HTTP protocol, and file:// URIs access the filesystem directly. –  grawity Mar 1 '11 at 13:30
    
It's still subject to how the browser passes parameters - which is down to the CGI protocol. –  Majenko Mar 1 '11 at 15:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.