Passing command line parameters to VM-based programs


  • I'm trying to figure out how to pass a command line parameter to a program inside the XP Mode VM. I haven't been able to find out much info about this, so I thought I'd ask you guys.

    More specifically, I want to pass command line parameters to Internet Explorer 6 to tell it to open a URL. The URL can be arbitrary so I can't simply create a batch file to load IE w/ a predefined site or anything like that.

    (The end goal here is to use this Firefox extension: to have the following context menus:
    • Open Page in IE6 (will open the current page in VM copy of IE6)
    • Open Page in IE7 (ditto, but for IE7 in a different VM image)
    • Open Page in IE8 (native IE8 in win7)

    Any ideas?

    Thanks for any insight you can provide on this.
    Monday, September 21, 2009 10:07 PM

All replies

  • Check the help in the Programming language you use to see how to pass parameters to a program. To call a program in a VM from the host will be impossible I think.
    Tuesday, September 22, 2009 2:43 AM
  • If the idea is to launch the commandline to start the app as a virtual app, you can publish cmd.exe (make a shortcut to cmd.exe in %allusersprofile% \start menu inside the vm) from the vm. Now, launch the published cmd.exe, and you can launch just about any app installed in the vm, this should give you the flexibility to launch the programs with comandlines that will run as other virtual apps.
    Thanks, Rashmi U.R
    • Marked as answer by Russell Weed Thursday, September 24, 2009 7:56 PM
    • Unmarked as answer by Russell Weed Thursday, September 24, 2009 7:57 PM
    Tuesday, September 22, 2009 7:02 PM
  • Wouldn't that would just open up a command prompt and I'd have to type in what I wanted? Not really what I had in mind.

    Instead of the VM just loading "iexplorer.exe" I want it to load "iexplorer.exe" or maybe "iexplorer.exe". The site would be completely arbitrary as the goal is for web site testing. I want to be on any particular page of a site and be able to right-click and launch that same URI into IE6,7, or 8. Does this make sense?

    Virtual PC is smart enough to load up the VM then launch a specific process, so I wouldn't think that it'd be that much harder to throw pass parameters into that process as well. I mean it's certainly less complicated than the stuff it already does like device and clipboard sharing...
    Thursday, September 24, 2009 8:05 PM
  • Don't suppose anyone has any more experience with this now that Win7 final is out?

    I noticed that File Associations work between the host and the VM, and it seems to launch them using OpenWithProgids. Is there any way this could be leveraged to do what I want?
    Friday, October 30, 2009 8:59 PM
  • You should create shortcut for you program and command line in VM and publish it on host. This should work.
    Thanks, -Vinod -- "This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use."
    Thursday, February 18, 2010 4:47 AM
  • Yes quite like this: but it can only be achieved programmatically : look under: "Manual Publishing". Customize the give VB Script as per your need. It has a field for 'Command Lines'.

    Thursday, March 01, 2012 4:49 PM