Jump to content

Create Shortcut without quotes


copyleft
 Share

Recommended Posts

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?

properties.gif

Link to comment
Share on other sites

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

  • 3 weeks later...

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

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...