Kaii787
Kaii787

Reputation: 1

How To Send Command Lines Variables to PRNQCTL.VBS

I want to be able to send the username and password over to the prnqctl script. I know what I have below does not work. Returning subscript out of range error. But how do I get something like this over to prnqctl.vbs. I don't want to hard-code the username and password as they can change or expire.

set /p USR =Username:
set /p PAS =Password: 

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnqctl.vbs -x -s SERVER01 -p PRINTER01 -u Domain\ %USR% -w %PAS%

Upvotes: 0

Views: 75

Answers (1)

MC ND
MC ND

Reputation: 70943

You have spaces included in the name of the variable

set /p USR =Username:
set /p PAS =Password: 
          ^............This space is included in the variable name

So, you have variables named %USR % and %PAS %. Remove the spaces to solve the problem

Upvotes: 2

Related Questions