Sign in to follow this  
Followers 0
midiman

exe will not execute when I run my script

15 posts in this topic

Hi I am trying to execute an exe located on my C:\. When i try to run it from my script it will not open.

I am using Run commang with the follwing path ("C:\AR\Risk.exe")

If I manually click on the exe I get a UAC message saying "Do you want to allow the following program to make changes to this computer?" Yes or No

What could be causing this exe to not run when I run my script.

Share this post


Link to post
Share on other sites



I don't know what could be causing it not to run, I've had some strange things happen with the run command. Try using ShellExecute() and see if that works


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

I don't know what could be causing it not to run, I've had some strange things happen with the run command. Try using ShellExecute() and see if that works

Hi,

try #RequireAdmin at the beginning of your script.

;-))

Stefan

Share this post


Link to post
Share on other sites

Ah, yeah, #RequireAdmin was another thing that I was thinking of, but I couldn't remember it at the time. Doesn't that prevent the script from running if it's not an admin account?


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hi,

if you start the script and you are not admin, the admin logon dialog should appears.

@midiman

What could be causing this exe to not run when I run my script.

You already answered this question.

->

I get a UAC message saying "Do you want to allow the following program to make changes to this computer?" Yes or No

This is normal behaviour, if UAC (User Account Control) is switched on and your program needs administrative rights for execution.

;-))

Stefan

Edited by 99ojo

Share this post


Link to post
Share on other sites

Thanks

#RequireAdmin at the top of the script worked.

Share this post


Link to post
Share on other sites

When the UAC prompt comes up.

How do I set the focus to yes and then send an enter?

Thanks

Share this post


Link to post
Share on other sites

midiman,

Think about what you are asking for a moment. :huggles:

What would be the point of a UAC dialog if you could click it programatically ? :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Indeed....

:D

Share this post


Link to post
Share on other sites

I know but this is annoying.

The program is an add on for excel and I want to automate it. Because I need to install it on over 100 machines.

So I am going to have to accept the UAC every time?

Thanks

Share this post


Link to post
Share on other sites

midiman,

So I am going to have to accept the UAC every time?

As I said above, what is the point of UAC if the user does not have to decide whether an action should take place ot not? :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

you could try making the script turn off UAC, add it's self to the start up list, restart (for UAC to take effect) do it's thing, then reset UAC, and take its self off the start up list, and restart... just a suggestion, may/may not work


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

mistersquirrle,

Do you really think that will work? :D

As the Prime Minister is wont to say at Question Time: "I refer the Honourable Member to my previous answers". UAC protects itself just as much as any other critical area - it would not be any use otherwise.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Meh... I thought it was worth a mention. I seem to remember being able to run some script to disable UAC without it bothering me... I don't use UAC cause it's annoying and it serves no purpose for me (since I don't run random AWESOME-PROGRAM.EXE, and such)

UAC's lame


RAWR! I'm hungry :( Feed the panda squirrle

Share this post


Link to post
Share on other sites

I,m new to this and this is my first script. Lets keep things simple lol.

So how can I do this?

When the first install page opens I am presented with a next or cancel option.

What would I use to press enter on the next button which has the focus.

I am using :

#requireadmin

Run("C:\AR\5Pro.exe")

WinWaitActive("5Pro for Excel - InstallShield Wizard","&Next >")

Send("!n")

But it's not working

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  
Followers 0