alexm963 Posted September 20, 2017 Share Posted September 20, 2017 Ok, so I am trying to make a seemingly simple shortcut. As can be seen in my code snippet. The target of the .lnk should look like this: %comspec% /c start "" "C: blah blah blah \script.exe" Instead what I get is this: "%comspec% /c start "" "C: blah blah blah \script.exe" Any ideas how to get rid of that leading quotation mark? FileCreateShortcut('%comspec% /c start ' & '""' & ' "' & @DesktopDir & "\" & $Unpack & '.exe"', @DesktopDir & "\" & $Unpack & ".lnk","","","","","{F6}") Link to comment Share on other sites More sharing options...
Danp2 Posted September 21, 2017 Share Posted September 21, 2017 Have you tried it using the 4th (args) parameter instead of stuffing everything into the 1st parameter? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
alexm963 Posted September 21, 2017 Author Share Posted September 21, 2017 I tried looking in to how to use it but I can't find what I would put in there. Is there something in the help file or where? Link to comment Share on other sites More sharing options...
Danp2 Posted September 21, 2017 Share Posted September 21, 2017 Yes. Did you look at the example? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
alexm963 Posted September 21, 2017 Author Share Posted September 21, 2017 (edited) Yes I understand that text can be put in but what are valid arguments to pass to autoit executables? Edited September 21, 2017 by alexm963 Link to comment Share on other sites More sharing options...
Danp2 Posted September 21, 2017 Share Posted September 21, 2017 In your earlier example, %compspec% is the actual program being run. The rest could be passed as an argument. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
alexm963 Posted September 21, 2017 Author Share Posted September 21, 2017 The program in opening with the shortcut is my script.exe. Running it through comspec just made it open a new instance of the script instead of just making it active if it is already open. My script.exe looks for other instances of itself and closes them right when it starts. If I try to run the shortcut with a hot key it doesn't open a new instance. It makes the current one active. I want it to open a new instance. Link to comment Share on other sites More sharing options...
Danp2 Posted September 22, 2017 Share Posted September 22, 2017 @alexm963 And what does this have to do with your original issue? Has that been resolved? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
alexm963 Posted September 22, 2017 Author Share Posted September 22, 2017 This was the solution I found for this issue. If I manually make a shortcut with a target of : %comspec% /c start "" "C: blah blah blah \script.exe" then the program will run as a new instance with the shortcut. Link to comment Share on other sites More sharing options...
alexm963 Posted September 22, 2017 Author Share Posted September 22, 2017 Solved. I ran FileGetShortcut to get the parameters that it was running when I made it manually. This works. FileCreateShortcut(@WindowsDir & "\system32\cmd.exe", @DesktopDir & "\" & $Unpack & ".lnk","","'/c start "" "' & @DesktopDir & "\" & $Unpack & '.exe"'","","","{F6}") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now