Sign in to follow this  
Followers 0

Specifying Command Line Options

4 posts in this topic

Is there a function or a way to specify command line options?

I want to just connect a printer using:

net use \\srv\printershare

How do I go about doing that?


Share this post

Link to post
Share on other sites

Run("net.exe use \\srv\printershare")

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: Hire The Brain Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post

Link to post
Share on other sites

Run("net.exe use \\srv\printershare")
I thought this would work but I just get a black screen flash with this and the printer doesn't get connected.

; This script is used to Provide the Users with a front end to map printers
;   Written by: Jesse Shumaker

;Required Include for creating GUI
#include <GUIConstants.au3>

GUICreate("", 400, 200)
GUICtrlCreateLabel("Select Your Desired Printer", 135, 10)
$compprinter = GUICtrlCreateButton("Computer Lab - HP LaserJet 2600n", 100, 90, 200, -1, $BS_DEFPUSHBUTTON)
$staffcopier = GUICtrlCreateButton("Staff Copier - Muratec MFX1", 100, 50, 200)
$close = GUICtrlCreateButton("Close", 150, 130, 100)

While 1
  $msg = GUIGetMsg()

    Case $msg = $compprinter
        Run("Net.exe USE \\apachesrv\PRNTAPASTAFFCOLRHP2600N")
    Case $msg = $staffcopier
        Run("Net.exe USE \\apachesrv\PRNTAPASTAFFBWMURATECMFX1X")
    Case $msg = $close

Share this post

Link to post
Share on other sites


it does the same thing as typing it in a dos box by hand :think:

You can also do this

;Run("Net.exe USE \\apachesrv\PRNTAPASTAFFCOLRHP2600N")
        Run(@ComSpec & " /c " & 'net use \\apachesrv\PRNTAPASTAFFCOLRHP2600N', "", @SW_HIDE)

       ;Run("Net.exe USE \\apachesrv\PRNTAPASTAFFBWMURATECMFX1X")
        Run(@ComSpec & " /c " & 'net use \\apachesrv\PRNTAPASTAFFBWMURATECMFX1X', "", @SW_HIDE)

So long,


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

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