error in expression

  • hi,

    bin gerade dabei ne daemontools.au3 zu schreiben nur funktioniert mount mal überhaupt nicht

    [autoit]


    Dim $path_img = "X:\image.cue"
    Dim $daemontoolspath = "C:\Programme\DAEMON Tools\daemon.exe"
    $test = _mountdtools($daemontoolspath, $path_img, 1)
    Msgbox(0,"",$test)

    [/autoit][autoit][/autoit][autoit]

    Func _mountdtools($path, $image, $device)
    If StringRegExp($path, "(daemon.exe)", 0, 1) = 1 AND StringRegExp($device, "[0123]") = 1 AND StringLen($device) = 1 Then
    Dim $image = '"'&$image&'"'
    Msgbox(0,"",$path)
    $command = $path&" -mount "&$device", "&$image
    Msgbox(0,"",$command)
    ;run($path&" -mount "&$device, $image)
    Return 1
    Else
    Return 0
    EndIf
    EndFunc ;==> _mountdtools($path, $image, $device)

    [/autoit]

    sollte eigentlich das image mounten, aber es klappt einfach nicht

    Auszug von der Daemontoolseite

    Einmal editiert, zuletzt von leviathan (13. Juni 2007 um 16:57)

    • Offizieller Beitrag

    Hallo,

    probiers mal so:

    [autoit]

    Dim $path_img = "X:\image.cue"
    Dim $daemontoolspath = "C:\Programme\DAEMON Tools\daemon.exe"
    $test = _mountdtools($daemontoolspath, $path_img, 1)
    MsgBox(0, "", $test)

    [/autoit][autoit][/autoit][autoit]

    Func _mountdtools($path, $image, $device)
    If StringRegExp($path, "(daemon.exe)", 0, 1) = 1 And StringRegExp($device, "[0123]") = 1 And StringLen($device) = 1 Then
    MsgBox(0, "", $path)
    $command = '"'&$path & '" -mount ' & $device & ', "' & $image & '"'
    MsgBox(0, "", $command)
    Run(@ComSpec & ' /c ' & $command, '', @SW_HIDE)

    ;run($path&" -mount "&$device, $image)
    Return 1
    Else
    Return 0
    EndIf
    EndFunc ;==>_mountdtools

    [/autoit]
  • als mit @ComSpec ging es nicht aber wenn ich es so mache

    [autoit]

    run('"'&$path & '" -mount ' & $device & ', "' & $image & '"')

    [/autoit]

    funktioniert es ;)

    Jetzt hab ich wieder gute Laune - thx bernd -> dafür wirst du natürlich erwähnt inna .au3 - will die halt für andere öffentlich machen