copyleft Posted November 20, 2019 Share Posted November 20, 2019 I need to create a shortcut with a switch in the "target" box of the shortcut properties window without quotation marks. The shortcut works if I put in the path, namually, without quotes. However, AutoIt seems to insert quotes whether I put the switch in the target field with the command or, seperately, in the "args" field. FileCreateShortcut("C:\Bin\Fine.exe", @StartMenuCommonDir & "\Programs\Scan\Scan2.lnk", "C:\Bin", "-StartMenuFine", "Scanner Search", "C:\Bin\Magnify.ico", "" , 0, @SW_SHOWNORMAL) FileCreateShortcut("C:\Bin\Fine.exe -StartMenuFine", @StartMenuCommonDir & "\Programs\Scan\Scan2.lnk", "C:\Bin", "", "Scanner Search", "C:\Bin\Magnify.ico", "" , 0, @SW_SHOWNORMAL) Is there a way to get around automatic quotes? Link to comment Share on other sites More sharing options...
Xenobiologist Posted November 20, 2019 Share Posted November 20, 2019 I tried this and it worked without any quotation in target/ziel. ConsoleWrite(FileCreateShortcut("c:\EigeneProgramme\bank21-Reporting-Manager\bank21-Reporting-Manager.exe", @DesktopDir & '\RM.lnk', "C:\", "-StartMenuFine", "RM", "", "", 0, @SW_SHOWNORMAL) & @crlf) Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
copyleft Posted December 11, 2019 Author Share Posted December 11, 2019 Sorry for radio silence. Thanks for your help. Link to comment Share on other sites More sharing options...
ur Posted December 13, 2019 Share Posted December 13, 2019 You can use my function which will remove double quotes if they exist, before specifying the target. #include <StringConstants.au3> Func trimQuotes($sName) if StringRight($sName, 1)="""" then $sName = StringTrimRight( $sName, 1 ) if StringLeft($sName, 1)="""" then $sName = StringTrimLeft( $sName, 1 ) if StringRight($sName, 1)="'" then $sName = StringTrimRight( $sName, 1 ) if StringLeft($sName, 1)="'" then $sName = StringTrimLeft( $sName, 1 ) return $sName EndFunc 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