sarco Posted September 17, 2009 Share 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 Link to comment Share on other sites More sharing options...
KaFu Posted September 17, 2009 Share 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 (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
99ojo Posted September 17, 2009 Share 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 Link to comment Share on other sites More sharing options...
sarco Posted September 17, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
99ojo Posted September 17, 2009 Share 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 Link to comment Share on other sites More sharing options...
sarco Posted September 17, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
KaFu Posted September 17, 2009 Share 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 (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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