potitpanda Posted March 28, 2008 Share Posted March 28, 2008 Hi I want to map a network drive using AutoIt Like NetUse command Is it possible with Autoit How to do this ? Thanks Potit Panda Link to comment Share on other sites More sharing options...
ptrex Posted March 28, 2008 Share Posted March 28, 2008 @potitpanda Why use "Net Use" if you can use native AU3 functions. $open = DriveMapAdd("Z:", "\\10.10.10.3\" & @UserName & "$", 0, "" & @UserName, $Password) Regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
sandin Posted March 28, 2008 Share Posted March 28, 2008 or, if you realy wanna use "net use" check this: http://www.cezeo.com/tips-and-tricks/net-use-command/example:;before you launch this script, make sure that your C drive is shared as share name: C #include <GUIConstants.au3> #include <Constants.au3> Opt("GUIOnEventMode", True) $Form1 = GUICreate("net use", 166, 105, 193, 115) $Button1 = GUICtrlCreateButton("create drive k:", 16, 8, 129, 30, 0) $Button2 = GUICtrlCreateButton("delete drive k:", 16, 48, 129, 30, 0) GUICtrlSetOnEvent($Button1, "createdrive") GUICtrlSetOnEvent($Button2, "deletedrive") GUISetOnEvent($GUI_EVENT_CLOSE, "_exit") GUISetState(@SW_SHOW) Func createdrive () Run(@ComSpec & " /c " & "net use k: \\127.0.0.1\c", "", @SW_HIDE ,$STDERR_CHILD + $STDOUT_CHILD) EndFunc func deletedrive () Run(@ComSpec & " /c " & "net use k: /DELETE", "", @SW_HIDE ,$STDERR_CHILD + $STDOUT_CHILD) EndFunc func _exit () Exit EndFunc While 1 Sleep(10) WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
potitpanda Posted March 28, 2008 Author Share Posted March 28, 2008 (edited) Other question If i Want to open \\SERVER\Pathname with user and pass from local computer, without see the Window wich commands can i use ? This is a shared directory of my server Edited March 28, 2008 by potitpanda Link to comment Share on other sites More sharing options...
weaponx Posted March 28, 2008 Share Posted March 28, 2008 Other question If i Want to open \\SERVER\Pathname with user and pass from local computer, without see the Window wich commands can i use ?This is a shared directory of my serverWhat do you intend to do with this window that cannot be seen? You mean an explorer window? Link to comment Share on other sites More sharing options...
potitpanda Posted March 28, 2008 Author Share Posted March 28, 2008 What do you intend to do with this window that cannot be seen? You mean an explorer window?NO I Explain this I have a local account on my computer, when I execute with "Start" - "Execute" shortcuts on WindowsXPI enter the line "\\Server\Shared"When I click on EnterWindows ask me to login on the server with Domain Login and passwordAnd give me access to this resourceWhy can I acces with autoit commands to this resource without map a drive but using this method.Do you understand my question ? Thanks for replys Link to comment Share on other sites More sharing options...
notorius Posted March 29, 2008 Share Posted March 29, 2008 hm try this method. #include <Process.au3> _RunDOS("net use x: /delete /yes > nul") _RunDOS("net use x: \\Server\Shared yourpasswordhere /user:Administrator") MsgBox( 0, "Done", "Network Up", 3) Its also mapping a driveletter but at least your avoiding to type anything before access. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now