Jump to content

Syntax Error Set Objnetwork?


Recommended Posts

Hi

Allow me to present my problem altough I'm so very stupid when it comes to programing...

I've got a script called map_printers.vbs which map some printers when launched. When I paste this snippet into AutoIT (Scitex) I get an error. This is the code:

Set objNetwork = CreateObject("WScript.Network") 
objNetwork.AddWindowsPrinterConnection "\\server\prt1"
objNetwork.AddWindowsPrinterConnection "\\server\prt2"
objNetwork.AddWindowsPrinterConnection "\\server\prt3"

Errormessage:

(1,5) : ERROR: syntax error Set objNetwork

If anyone could help me get kickstarted I would really like it!

Roll on & thanks!

/Marcus

Link to comment
Share on other sites

  • Developers

This is still vbs code ... not autoit3...

Should be something like this: (Untested)

$objNetwork = ObjCreate("WScript.Network") 
$objNetwork.AddWindowsPrinterConnection ("\\server\prt1")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This is still vbs code ... not autoit3...

Should be something like this: (Untested)

$objNetwork = ObjCreate("WScript.Network") 
$objNetwork.AddWindowsPrinterConnection ("\\server\prt1")
Dude, that was a fast answer!!! SWEET!

Your example didn't work, by the way.

(1) : ==> Unknown function name.:

Cheers!

Link to comment
Share on other sites

  • Developers

Dude, that was a fast answer!!! SWEET!

Your example didn't work, by the way.

Cheers!

You need to use the Beta version of AutoIt3 .......

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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