Jump to content

Recommended Posts

Posted

Hi All:

I'm quite new at Autoit and am having a bit of a problem with how to use a variable inside a set of two double quotes. The command as would be issued at a normal command prompt is below:

ntdsutil roles "conn co to ser server1" q "seize pdc emulator" q q

Using information I have found here I should do the following in Autoit to make the above command work:

Run (@ComSpec & " /C " & "ntdsutil roles conn ""co to ser server1"" q ""seize pdc emulator"" q q")

The problem I have is that I wish to replace server1 with a variable and also pdc emulator with a variable and have been unable to find a solution.

Would anyone be able to assist me with this?

Thank you.

B

Posted (edited)

Use single quotes(') as oppose to regular quotes(") where you need to.

You know I always found the help file helpful

Edited by timsta97
Posted

Single quotes are useful in such cases because it makes the text less confuse.

I have replaced the begining/end double quotes with single to help you understand the result.

Run (@ComSpec & ' /C ' & 'ntdsutil roles conn ""co to ser '&$1stVAR&'"" q ""seize '&$2ndVAR&'"" q q')

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Posted

Enaiman: Thank you very much for your help, much appreciated.

Timsta97: Thank you for your suggestion. Oddly enough I too find the help file very helpful and at times this forum even more so.

B

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
×
×
  • Create New...