Jump to content

problem running external problems


Recommended Posts

Hi there,

I am suddenly having problems running externally called programs. I am trying to run taskkill from a run command and

it was working up to yesterday but now i cannot seem to get it to work anymore. It comes up with the following error

Run("taskkill.exe /F /IM explorer.exe")

Unable to execute the external program.

The directory name is invalid.

If i try and replace this with another run command calling e.g notepad it comes up with exactly the same error. I am not sure if it's something higher up in the script that is causing this.

Any suggestions???

Thanks

Here is the script from the start up to the taskkill

#include <GUIConstants.au3>

#include <IE.au3>

dim $USERNAME

$ScreenHeight = (@DesktopHeight - 130) / 2

$ScreenWidth = (@DesktopWidth - 220) / 2

; Create GUI and Progress Bar

GUICreate($Heading,220,130,$ScreenWidth,$ScreenHeight,-1, $WS_EX_TOPMOST)

$n=GUICtrlCreatePic($ImagePath,50,0,100,70)

$progressbar1 = GUICtrlCreateProgress (10,70,200,20)

GUICtrlSetColor(-1,32250)

$Label = GUICtrlCreatelabel ("Starting Build Progress - please wait...",10,100,200,20)

GUISetBkColor(0xFFFFFF)

GUISetState ()

; Map Drive

GUICtrlSetData($progressbar1,1)

GUICtrlSetData($label,"Mapping Drive")

DriveMapAdd("X:", $MappingPath)

;Disable user input

GUICtrlSetData($progressbar1,5)

GUICtrlSetData($label,"Blocking User Input")

BlockInput(1)

; Run registry entries

GUICtrlSetData($progressbar1,10)

GUICtrlSetData($label,"Running Registry Entries")

run("regedit /s x:\newbuild\newbuildregentries.reg","c:\windows")

; explorer

GUICtrlSetData($progressbar1,10)

GUICtrlSetData($label,"Stopping Explorer")

Run("taskkill.exe /F /IM explorer.exe")

Link to comment
Share on other sites

Do TaskKill.exe and notepad.exe run for you from a regular command line? I'm wondering if your PATH environment variable may have become invalid.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...