Sign in to follow this  
Followers 0
quietus24

Using a Variable in a ComSpec Line?

4 posts in this topic

Hi All,

I am trying to create a script that allows a machine name to entered into an Inputbox and that input use in a comspec line....

I have not been successfuly. I have put it in single quotes, double, etc. Not sure how to accomplish this.

Look through help file, this seemed to specific.

THANKS!

$answer = InputBox("Bitlocker Recover Password Query", "Enter the Machine Name", "", "", _

-1, -1, 0, 0)

RunWait(@ComSpec & " /k " & 'dsquery * "CN=$answer,OU=Workstations,OU=Practice Office,DC=us,DC=Company,DC=com" -scope subtree -attr msFVE-RecoveryPassword',"", @SW_MAXIMIZE)

Share this post


Link to post
Share on other sites



RunWait(@ComSpec & " /k " & 'dsquery * "CN=" & $answer & ",OU=Workstations,OU=Practice Office,DC=us,DC=Company,DC=com" -scope subtree -attr msFVE-RecoveryPassword',"", @SW_MAXIMIZE)

Hope It Helps.

Thanks.

Swift

Share this post


Link to post
Share on other sites

RunWait(@ComSpec & " /k " & 'dsquery * "CN=" & $answer & ",OU=Workstations,OU=Practice Office,DC=us,DC=Company,DC=com" -scope subtree -attr msFVE-RecoveryPassword',"", @SW_MAXIMIZE)

Hope It Helps.

Thanks.

Swift

SWIFT!!!

Thanks a lot... that was close.....had to surround the variable with single quotes as you cannot have doubles within double next to each other.....

THANKS!

Share this post


Link to post
Share on other sites

Your Welcome :)

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