Jump to content

Using a Variable in a ComSpec Line?


 Share

Recommended Posts

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)

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

Link to comment
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!

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