Jump to content

Using "Run" with a ClickOnce .net app


Recommended Posts

Hi folks,

I'm having trouble using AutoIt's Run command to launch a ClickOnce style application.

If I type this in Windows "Run ..." box from the Start Menu, it works fine: ( application launches )

"C:\Documents and Settings\pelwer1\Start Menu\Programs\Change Management System II\CMSII.appref-ms"

If I put this into AutoIt and run the script nothing happens: ( AutoIt exits normally, but the app doesn't launch )

; StartCMS
Run( @StartMenuDir & "\Programs\Change Management System II\CMSII.appref-ms" )

I also tried this and also got nothing:

; StartCMS
Run( "C:\Documents and Settings\pelwer1\Start Menu\Programs\Change Management System II\CMSII.appref-ms" )

Any clues as to what I'm doing wrong?

thanks

Pat.

Link to comment
Share on other sites

You can't really run a appref-ms like you can a normal executable. If you manage to open it you'll see that it really does reference an application (that's online).

There are only a few methods to "run" them:

Open a webpage (in IE) with the location set to the appref-ms file.

start it using command line and start command: cmd /c start C:\your.appref-ms

Note that if you try doing this on startup; that's a whole different problem.

Edit: ClickOnce will give you more trouble when you try to do anything with it that it's not designed to do (be started by another application for example). Simple solution: Move away from ClickOnce.

Edited by Manadar
Link to comment
Share on other sites

  • 2 weeks later...

Hello! This is my first post, and I'm very new to AutoIt.

Our company using appref-ms to start one of our applications...I tried using the examples given, but none of them are working. Is there anything you can recommend? If I do need to use a browser to launch the app, can you please provide some code to get me started?

I would really appreciate it, thanks!

-George

You can't really run a appref-ms like you can a normal executable. If you manage to open it you'll see that it really does reference an application (that's online).

There are only a few methods to "run" them:

Open a webpage (in IE) with the location set to the appref-ms file.

start it using command line and start command: cmd /c start C:\your.appref-ms

Note that if you try doing this on startup; that's a whole different problem.

Edit: ClickOnce will give you more trouble when you try to do anything with it that it's not designed to do (be started by another application for example). Simple solution: Move away from ClickOnce.

Link to comment
Share on other sites

Actually, through trial and error, I got this to work (using the example in the first post):

Run(@comspec & " /c " & chr(34) & "C:\Documents and Settings\pelwer1\Start Menu\Programs\Change Management System II\CMSII.appref-ms" & chr(34))

Hello! This is my first post, and I'm very new to AutoIt.

Our company using appref-ms to start one of our applications...I tried using the examples given, but none of them are working. Is there anything you can recommend? If I do need to use a browser to launch the app, can you please provide some code to get me started?

I would really appreciate it, thanks!

-George

Link to comment
Share on other sites

  • 5 years later...

 Run('C:Usersjayant.sinhaAppDataRoamingMicrosoftWindowsStart MenuProgramsABC IncIndiaDevops.appref-ms')

plz help how to understand Run(@comspec & " /c cd " & chr(34) & @StartMenuDir & "ProgramsChange Management System II" & chr(34) & " && start " & "CMSII.appref-ms")

with respect to my application. how i can run.

Edited by jayantsinha7
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...