Jump to content

Quotes Problem


Recommended Posts

Hi all,

I am encountering problems when using Runwait with dos command line.

See below (part of the code):

$Elements[0] = "Network printers"

$RepCible = "u:\Saveprofiles"

$TreeCreate[0] = $RepCible & "\" & $Elements[0]

RunWait(@ComSpec & " /c " & 'reg export HKCU\Printers " & $TreeCreate[0] & "\HKCU_PRINTERS.reg', "", @SW_HIDE)

Runwait won't work cause the Dos "reg export" command need to be in quotes (cause of the space included in network printers); the problem is that Autoit already use quotes for himself :) .

Can anyone help me please to allow the "quoting" of quotes??

Thanx in advance.

Xavier

The newbie

Link to comment
Share on other sites

RunWait(@ComSpec & " /c " & 'reg export "HKCU\Printers ' & $TreeCreate[0] & '\HKCU_PRINTERS.reg"', "", @SW_HIDE)

<{POST_SNAPBACK}>

:) Hum it seems like it doesn't work !

would yo have a sample of quotes in dos command for me?

Link to comment
Share on other sites

RunWait(@ComSpec & "" /c reg export HKCU\Printers" & '$TreeCreate[0]' & "\HKCU_PRINTERS.reg"", "", @SW_HIDE)

Thats a stab in the dark but try it any way lol.

<{POST_SNAPBACK}>

I left the msgbox in so you could see the results... Hope this is what you were looking for.

$Elements[0] = "Network printers"
$RepCible = """c:\temp"
$TreeCreate[0] = $RepCible & "\" & $Elements[0]

; RunWait(@ComSpec & ' /c ' & 'reg export HKCU\Printers ' & $TreeCreate[0] & '\HKCU_PRINTERS.reg"', '', @SW_SHOW)

; OR you can do this...
    
$Elements[0] = "Network printers"
$RepCible = """c:\temp"
$TreeCreate[0] = $RepCible & "\" & $Elements[0]

$sString = @ComSpec & ' /c ' & 'reg export HKCU\Printers ' & $TreeCreate[0] & '\HKCU_PRINTERS.reg"'; You now have QUOTES!!!

msgbox(0, "", $sString, 10)

; RunWait($sString, '', @SW_SHOW)

Kerby

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