Jump to content

Specifying Command Line Options


Recommended Posts

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 is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
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)
GUISetState(@SW_SHOW)

While 1
  $msg = GUIGetMsg()

  Select
    Case $msg = $compprinter
        Run("Net.exe USE \\apachesrv\PRNTAPASTAFFCOLRHP2600N")
        
    Case $msg = $staffcopier
        Run("Net.exe USE \\apachesrv\PRNTAPASTAFFBWMURATECMFX1X")
              
    Case $msg = $close
        ExitLoop
  EndSelect
WEnd
Link to comment
Share on other sites

Hi,

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,

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

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