Jump to content
Sign in to follow this  
PowerCat

Using RunAs with arguments and variables

Recommended Posts

PowerCat

I'm trying to get this command working properly but to no avail!

Run(@ComSpec & " /c dsquery computer -name " & @ComputerName & " | dsmod computer -desc " & GuiCtrlRead($compdesc) & "")

As for this command, I can get the command to go as far as getting the computer name, but the part where it reads $compdesc still won't run.

The argument passed to dsmod needs to include quotation marks but I'm having a hard time putting enough quotation marks and apostrophes to get it running.

I was able to get enough quotation marks to change the computer description to "GuiCtrlRead($compdesc)" but that's not helpful!

Where am I going wrong?

Thanks!

Share this post


Link to post
Share on other sites
AdmiralAlkex

Try displaying it in a MsgBox(), you should then be able to see what the error is.

MsgBox(0, "", @ComSpec & " /c dsquery computer -name " & @ComputerName & " | dsmod computer -desc " & GuiCtrlRead($compdesc) & "")
Edited by AdmiralAlkex

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  

×