Jump to content

Problem using & within a quote


Recommended Posts

this works:

$app = _GetDefaultApp(".html", 1)
Run($app & " start http://www.eqtraders.com/search/search.php?data[item]="&$data3&"&min=0")

;-------------------

;===============================================================================
; Function:   _GetDefaultApp($sExtension)
; Description:      Returns default application corresponding to the given file extension.
; Parameter(s):     $sExtension - The file extension to check.
;               $nOption   - 1: Return Longname(Default)
;                        - 0: Return Shortname
; Requirement(s):   None
; Return Value(s):  On Success - Returns a string containing the complete path to the executable
;                   On Failure - 0  and Set
;                                   @ERROR to:  1 - Invalid Extension/Unknown Error
; Author(s):        Chris95219
; Note(s):
;
;===============================================================================
Func _GetDefaultApp($sExtension, $nOption = 1)
    $sRegTop = RegRead("HKEY_CLASSES_ROOT\" & $sExtension, "")
    if ($sRegTop == "") Then
        SetError(1)
        Return 0
    Else
        $sExec = StringReplace(StringReplace(RegRead("HKEY_CLASSES_ROOT\" & $sRegTop & "\Shell\Open\command", ""), "%SystemRoot%", @WindowsDir), Chr(34), "")
        ;Remove the paramaters
        $sTemp = StringSplit($sExec, ".")
        if ($nOption == 1) Then
            Return FileGetLongName($sTemp[1] & ".exe")
        Else
            Return FileGetShortname($sTemp[1] & ".exe")
        EndIf
    EndIf
EndFunc

Dunno why it does'nt work with _RunDOS() though :lmao:

Edited by CHRIS95219
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...