Sign in to follow this  
Followers 0
Xavier

Quotes Problem

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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?

Share this post


Link to post
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.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0