Sign in to follow this  
Followers 0
Marcus Sthlm

Syntax Error Set Objnetwork?

5 posts in this topic

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

Share this post


Link to post
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")

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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

Wohoo! Your example works now! I guess it did all the time, but it works for me. After installing beta. Am I annoying? Naw, just happy. Thanks mate!

:)

Carry on! =)

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  
Followers 0