Jump to content

Recommended Posts

Posted

Good day,

I have been attempting to create a create an argument within a "cmd statement"

For example:

; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
CreateOn_SignInLink()
; -----------------------------------------------
Func CreateOn_SignInLink()
    Local $targetPath = "C:\Windows\System32\cmd.exe"
    Local $Argument = "D:\App_Install\Digital_Audio\name\Assets\On_SignInTest.au3"
    Local $sDstPath = "D:\App_Install\Digital_Audio\name\Assets\On_SignInTest.lnk"
    ; -----------------------------------------------
;~  FileCreateShortcut($targetPath, $sDstPath, "", '/c start "" "D:\App_Install\Digital_Audio\name\Assets\On_SignInTest.au3"')
    FileCreateShortcut($targetPath, $sDstPath, "", '/c start "" & $Argument)
EndFunc   ;==>CreateOn_SignInLink
; -----------------------------------------------

The string succeeding ", "", '/c start """ is what I wish to make into a variable - in this case, "$Argument".

The following was suggested, but I have been unable to get this work?!

Local $Argument = "/c start ""YourExecutable.exe"" /high"

Any ideas?!?

Posted

A slight update:

; -----------------------------------------------
#include <FileConstants.au3>
; -----------------------------------------------
Opt("MustDeclareVars", 1)
; -----------------------------------------------
CreateSignInTestLink()
; -----------------------------------------------
Func CreateSignInTestLink()
    Local $targetPath = "C:\Windows\System32\cmd.exe"
    Local $sDstPath = "C:\Users\RML_User\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\On_SignInTest.lnk"
    ; -----------------------------------------------
    FileCreateShortcut($targetPath, $sDstPath, "", '/c start "" "D:\App_Install\Digital_Audio\1_RMLLabs\Assets\On_SignInTest.au3"', "", "", "", 0, 7)
EndFunc   ;==>CreateSignInTestLink
; -----------------------------------------------

 

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
×
×
  • Create New...