Jump to content

Newbie question


 Share

Recommended Posts

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

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

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