sirstox2 Posted October 16, 2009 Share Posted October 16, 2009 Getting error message about illegal statement on 1 per line. Any Help or suggestion would be welcome and appreciated. Trying to make a exe that will change a printer from using usb to lpt1, has to be local admin to have rights to complete this task. " $admminuser = "administrator" $adminpass = "password" $admindomain = @ComputerName Func _RunAsAdmin($cmd) RunAs($adminuser, $admindomain, $adminpass, 0, $cmd) EndFunc;==>_RunAsAdmin $var = 'net use LPT1: \\', @ComputerName, '\Receipt' _RunAsAdmin($var) " Thanks sirstox Link to comment Share on other sites More sharing options...
FuryCell Posted October 16, 2009 Share Posted October 16, 2009 This line is invalid $var = 'net use LPT1: \\', @ComputerName, '\Receipt' Are you trying to combine in to one string. If so: $var = 'net use LPT1: \\' & @ComputerName & '\Receipt' HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now