Sign in to follow this  
Followers 0
ChrisL

object stuff

5 posts in this topic

Could someone please translate this to Autoit for me, I really don't understand

Dim net

Set net = CreateObject("WScript.Network")

net.AddWindowsPrinterConnection "\\btcdls013801\Cognitive LX 4 inch"

I want to add a network printer, if someone has a better way that would be great.

Thanks

Chris

Share this post


Link to post
Share on other sites



You know sometimes just posting on here gives you inspiration.

Does this look right?

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$net = ObjCreate ("WScript.Network")
$net.AddWindowsPrinterConnection ("\\btcdls013801\Cognitive LX 4 inch")

Func MyErrFunc()

  $HexNumber=hex($oMyError.number,8)    ; for displaying purposes
  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"       & @CRLF  & @CRLF & _
             "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
             "err.number is: "         & @TAB & $HexNumber              & @CRLF & _
             "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF _
            )
  SetError(1)  ; to check for after this function returns
Endfunc

Share this post


Link to post
Share on other sites

HI,

have you tried DOS: net use LPT1 \\<Server>\<Drucker>

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

You know sometimes just posting on here gives you inspiration.

Does this look right?

Yes

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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