Sign in to follow this  
Followers 0
pelwer

Using "Run" with a ClickOnce .net app

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



You could try this!

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

Share this post


Link to post
Share on other sites

No Joy, but this seems to work ( found this in another post on running ClickOnce apps )

Run(@comspec & " /c cd " & chr(34) & @StartMenuDir & "\Programs\Change Management System II\" & chr(34) & " && start " & "CMSII.appref-ms")

It works, but I have no idea what it's doing! :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

 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

Share this post


Link to post
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
Sign in to follow this  
Followers 0