Jump to content
Sign in to follow this  
sarco

AutoIt application doesnt execute everything when called from another application

Recommended Posts

sarco

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 by sarco

Share this post


Link to post
Share on other sites
KaFu
99ojo

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

Share this post


Link to post
Share on other sites
sarco

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

Share this post


Link to post
Share on other sites
99ojo

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.

:D

Stefan

Edited by 99ojo

Share this post


Link to post
Share on other sites
sarco

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.

:D

Stefan

map_share.exe was just a bogus name :D Hyena calls directly accc.exe with the command accc.exe %E%

thanks,

Pedro

Share this post


Link to post
Share on other sites
KaFu

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.