sarco Posted September 17, 2009 Posted September 17, 2009 (edited) Hi all, this is my first call for help. At the company I'm working at, we are using a tool to perform all Active Directory related tasks. Within this tools we can integrate other tools so our daily tasks can get easier. I want to create an AutoIt executable that is called by the main tool, a parameter (hostname) is passed to the small utility. The small utility takes the given parameter and will map the remote administrative C$ partition to a drive letter and will start explorer on that drive letter. I have created the utility that runs fine when started from the command line (map_share.exe host_name) but it doesnt work when called from the main application. The utility gets the hostname as a parameter (I have checked that). I don't know what could be causing/missing. All the help will be apreciated. The code is as follows: ; - Code Start ; Map drive $strDriveLetter = "T:" $strNetShare = "\\" & $CmdLine[1] & "\c$" ;MsgBox(4096, "Test", $strNetShare, 10) DriveMapAdd($strDriveLetter, $strNetShare) ; Explore network share Run("C:\WINDOWS\EXPLORER.EXE /n," & $strDriveLetter) Exit ; - Code End Thanks, Sarco Edited September 17, 2009 by sarco
KaFu Posted September 17, 2009 Posted September 17, 2009 Is the tool started under a user context with sufficient rights to do the mapping? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
99ojo Posted September 17, 2009 Posted September 17, 2009 Is the tool started under a user context with sufficient rights to do the mapping?Hi,You also should post your call from the main application....;-))Stefan
sarco Posted September 17, 2009 Author Posted September 17, 2009 The utility is started under a user account with sufficient permissions. The main tool is Hyena and the command that is passed is: accc.exe %E%, where %E% is the hostname. Thanks, sarco
99ojo Posted September 17, 2009 Posted September 17, 2009 (edited) Hi, do i miss something? Your exefile with command is map_share.exe host_name and you call it from hyena with accc.exe %E% ???? Or is map_share.exe called from accc.exe??? If yes, you should proof the calling from accc.exe for map_share.exe. Stefan Edited September 17, 2009 by 99ojo
sarco Posted September 17, 2009 Author Posted September 17, 2009 Hi,do i miss something?Your exefile with command is map_share.exe host_name and you call it from hyena with accc.exe %E% ????Or is map_share.exe called from accc.exe??? If yes, you should proof the calling from accc.exe for map_share.exe. Stefanmap_share.exe was just a bogus name Hyena calls directly accc.exe with the command accc.exe %E%thanks,Pedro
KaFu Posted September 17, 2009 Posted September 17, 2009 So, some more error checking? $strDriveLetter = "T:" $strNetShare = "\\" & $CmdLine[1] & "\c$" ;MsgBox(4096, "Test", $strNetShare, 10) DriveMapAdd($strDriveLetter, $strNetShare) MsgBox(262144,"",@error) ShellExecute($strDriveLetter & "\") Exit OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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