Jump to content
Sign in to follow this  
Docfxit

I can't get the Run program to launch the program

Recommended Posts

If I run this script in Windows 7 it runs fine.  When I run it Windows 10 the Run on line 15 won't launch the program.

Does anyone have any idea how I can get it to run or how I can test it to figure out why it isn't running?

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
TrayTip("clears any tray tip","",0)
AutoItSetOption("TrayIconDebug", 1) ;0-off
#include "OSVersion.au3"
$OSVersion = _OSVersion()
If $OSVersion = 'Win7' Or $OSVersion = 'Win7SP1' Or $OSVersion = 'Win7X64' Or $OSVersion = 'Win7SP1x64' Then
    $ProgramFiles = "C:\Programs\"
Else
    $ProgramFiles = "C:\Program Files\"
EndIf
;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Run('C:\Dnload\9xAddons\TestRunVer.5.28.exe')
;The Program in the Run above this line won't launch in Windows 10
;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
MsgBox("","Test","$ProgramFiles - " & $ProgramFiles & @CRLF & "_OSVersion() - " & _OSVersion())
WinWait("TestRun","Please select a lang")
If Not WinActive("TestRun","Please select a lang") Then WinActivate("TestRun","Please select a lang")
WinWaitActive("TestRun","Please select a lang")
Send("{ENTER}")
WinWait("TestRun","")
If Not WinActive("TestRun","") Then WinActivate("TestRun","")
WinWaitActive("TestRun","")
Send("{ENTER}")
WinWait("TestRun","")
If Not WinActive("TestRun","") Then WinActivate("TestRun","")
WinWaitActive("TestRun","")
Send($ProgramFiles & "TestRun{ENTER}")
WinWait("TestRun ","")
If Not WinActive("TestRun ","") Then WinActivate("TestRun ","")
WinWaitActive("TestRun ","")
Send("{ENTER}")
WinWait("TestRun","")
If Not WinActive("TestRun","") Then WinActivate("TestRun","")
WinWaitActive("TestRun","")
Send("{ENTER}")
Sleep(100)
WinWait("TestRun","")
If Not WinActive("TestRun","") Then WinActivate("TestRun","")
WinWaitActive("TestRun","")
Send("{ALTDOWN}n{ALTUP}")
While 1 <> 1
WinWait("TestRun ","Driver Installation")
If Not WinActive("TestRun ","Driver Installation") Then WinActivate("TestRun ","Driver Installation")
WinWaitActive("TestRun ","Driver Installation")
Send("{ENTER}")
WinWait("TestRun ","Completing the Sandb")
If Not WinActive("TestRun ","Completing the Sandb") Then WinActivate("TestRun ","Completing the Sandb")
WinWaitActive("TestRun","Completing the Sandb")
Send("{ENTER}")
WEnd

WinWait("Software Compatibility","TestRun has detect")
If Not WinActive("Software Compatibility","TestRun has detect") Then WinActivate("Software Compatibility","TestRun has detect")
WinWaitActive("Software Compatibility","TestRun has detect")
Send("{ENTER}")
WinWait("Getting Started Tutorial - TestRun","Getting Started with")
If Not WinActive("Getting Started Tutorial - TestRun","Getting Started with") Then WinActivate("Getting Started Tutorial - TestRun","Getting Started with")
WinWaitActive("Getting Started Tutorial - TestRun","Getting Started with")
Send("{ALTDOWN}c{ALTUP}")
WinWait("TestRun Control","")
If Not WinActive("TestRun Control","") Then WinActivate("TestRun Control","")
WinWaitActive("TestRun Control","")
ProcessClose('TestRun.exe')


Exit

 

Share this post


Link to post
Share on other sites

 

Perhaps    C:\Program Files (x86)  probably not, see next post

If $OSVersion = 'Win7' Or $OSVersion = 'Win7SP1' Or $OSVersion = 'Win7X64' Or $OSVersion = 'Win7SP1x64' Then
    $ProgramFiles = "C:\Programs\"
Else
    $ProgramFiles = "C:\Program Files (x86)"
EndIf

 

Edited by Exit

App: Au3toCmd              UDF: _SingleScript()                             

Share this post


Link to post
Share on other sites

Better try this script:

$sRunFile = 'C:\Dnload\9xAddons\TestRunVer.5.28.exe'
;~ $sRunFile = @WindowsDir&'\notepad.exe'   ; decomment for testing purposes
If Not FileExists($sRunFile) Then
    ConsoleWrite("File not found: >" & $sRunFile & "<" & @CRLF)
    Exit MsgBox(16 + 262144, Default, "File not found: >" & $sRunFile & "<", 0)
EndIf
$pid = Run($sRunFile)
ConsoleWrite("PID=" & $pid & "  Error=" & @error & @CRLF)
MsgBox(64 + 262144, Default, "PID=" & $pid & @LF & "Error=" & @error, 0)

and show us the console output

decomment line 2 and show us again the console output


App: Au3toCmd              UDF: _SingleScript()                             

Share this post


Link to post
Share on other sites

That's a great script.

C:\Dnload\9xAddons\TestRunVer.5.28.exe = PID=0  Error=1 
C:\Windows\notepad.exe = PID=1192  Error=0

So that proves it doesn't run and there is some kind of error.

Thanks,

Share this post


Link to post
Share on other sites

If you right click on that program does it have a block on it something along the lines of..

' this program was downloaded from another computer and Windows has prevented it from running on your PC'

With an option to unblock? Not sure if W10 has this still

Share this post


Link to post
Share on other sites
4 minutes ago, Bilgus said:

If you right click on that program does it have a block on it something along the lines of..

' this program was downloaded from another computer and Windows has prevented it from running on your PC'

With an option to unblock? Not sure if W10 has this still

I don't see anything like that.

Thanks for the suggestion.

Share this post


Link to post
Share on other sites

I tried adding the  AutoIt Error Handler suggestions at:

one at a time.

I couldn't get any of them to work in SciTE ver.4.1.2 AutoIt ver.3.3.14.5

I was hoping they might shed some light on this not running.

 

Share this post


Link to post
Share on other sites

it is an executable compressor and the latest versions have issues in w10 so IDk if your program has been compressed with it but it is possible.. the packer will tell you if it is already compressed and if it isn't it might just solve the issue as well I remember using UPX back in the day to get around some weird EXE issues in windows

 

https://github.com/upx/upx/issues/253

Edited by Bilgus

Share this post


Link to post
Share on other sites

It certainly reduced it's size.

AutoIt compiled exe version 866,816

UPX exe version 387,584

It still didn't run.

By accident I tried running it elevated (Run as administrator)  and it ran.

I don't understand why it would need to Run as administrator.

 

Share this post


Link to post
Share on other sites

Oh I figured you already tried that >_<

Might check the permissions on it or try setting compatibility mode for the time being

#RequireAdmin at the top of the script is one option, there are others as well if look around the forum with varying amounts of difficulty

Share this post


Link to post
Share on other sites

Windows 10 is more 'secure' so its hard telling what functions now require administrator privileges versus older versions of windows

Share this post


Link to post
Share on other sites

OH and I meant for you to run UPX on your offending program 'C:\Dnload\9xAddons\TestRunVer.5.28.exe'

Scite has UPX built into it for autoit scripts but it tends to cause virus false positives since malware authors tend to UPX their Autoit scripts

Share this post


Link to post
Share on other sites
1 minute ago, Bilgus said:

OH and I meant for you to run UPX on your offending program 'C:\Dnload\9xAddons\TestRunVer.5.28.exe'

Scite has UPX built into it for autoit scripts but it tends to cause virus false positives since malware authors tend to UPX their Autoit scripts

Yes, I did.  Thanks.  I thought that's what you wanted me to do.

Share this post


Link to post
Share on other sites

#RequireAdmin  does work.

It's just very strange that it would require that.

I have change the permissions on the parent folder to the user currently logged in and I did make sure that I "Replaced all child permission entries with inheritable permission entries from this object"

I wonder why Win10 would require Administrative permissions to run a program.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...