Jump to content
Sign in to follow this  
sirstox2

Newbie question

Recommended Posts

sirstox2

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

Share this post


Link to post
Share on other sites
FuryCell

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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.