Jump to content

Fresh Windows 10 Pro - Run doesn't work properly


Recommended Posts

Hi,

 

I tried to find something regarding my issue, but I couldn't.

 

My scripts that were usually running fine on my previous Windows 7, are not running properly on my newly installed Windows 10 Pro.

 

Sleep(14000)
Run("C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe")
Sleep(5000)
Run("C:\Program Files\Core Temp\Core Temp.exe", "" ,@SW_MINIMIZE)
Sleep(5000)
WinSetState("Core Temp 1.1", "", @SW_MINIMIZE)
Sleep(1500)
Run("C:\Users\zyxsc\Documents\LCDHost\bin\LCDHost.exe","", @SW_MINIMIZE)
Sleep(15000)
WinClose("zyx - LCDHost")
Sleep(10000)
Run("C:\Program Files\Everything\Everything.exe -startup")

So what happens is:

MSIAfterburner does not open, Core Temp doesn't open, LCDHost.exe does open fine and closes the window fine, Everything.exe does not open.

 

Any idea why?

Edited by zYx
Link to comment
Share on other sites

The obvious first question is do those files exist in those locations and do they work if you run those commands manually?

Second question: check the process manager, are the processes really not started?

Third, check the result and errorlevel of the Run commands (as in $pid = Run("something") and then ConsoleWrite($pid & @CRLF & @error & @CRLF ) ) and see whether you get a pid and/or a non-zero @error.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Hi,

 

yes, all files do exist, task manager doesn't show those apps, so no, they are really not running.

 

I'm not sure how to follow your third advise :( do I just add  $pid =   in front of Run?

I did this:

Sleep(1000)
$pid = Run("C:\Program Files\Core Temp\Core Temp.exe", "" ,@SW_MINIMIZE)
ConsoleWrite($pid & @CRLF & @error & @CRLF )

but nothing really happens..

Could it be something to do with permission level to Program Files folders?

Edited by zYx
Link to comment
Share on other sites

$pid = Run("notepad.exe")
MsgBox(64, "notepad.exe pid:", $pid)

$pid = Run("doesntexist.exe")
MsgBox(64, "doesntexist.exe pid:", $pid)

The first one will (or rather should, if notepad.exe is run properly) show you a non-zero PID in the MsgBox, the second one will show a PID of 0 as the process failed to launch.

The permissions, sure, could be... For good measure, try putting #RequireAdmin on top of your script, run it and allow the process elevation.

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

put these two lines at the top

#include <WinAPIFiles.au3>
_WinAPI_Wow64EnableWow64FsRedirection(FALSE)

 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

11 minutes ago, iamtheky said:

#include <WinAPIFiles.au3> _WinAPI_Wow64EnableWow64FsRedirection(FALSE)

This didn't really work :(

but this did:

13 minutes ago, SadBunny said:

#RequireAdmin

In relation to this:

13 minutes ago, SadBunny said:

$pid = Run("notepad.exe") MsgBox(64, "notepad.exe pid:", $pid) $pid = Run("doesntexist.exe") MsgBox(64, "doesntexist.exe pid:", $pid)

I added MSI Afterburner locaton, but kept getting popup error with wrong PID etc..

err.jpg

Edited by zYx
Link to comment
Share on other sites

1 minute ago, zYx said:

kept getting popup error with wrong PID etc..

What do you mean? What kind of popup error and how is the PID wrong?

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

UAC or redirection, it's generally that coinflip on upgrade/architecture issues.  glad its not the issue, but If dancing between (x86) and x64 directory structure i would still recommend it.

Edited by iamtheky
posting/editing race condition

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

2 minutes ago, SadBunny said:

What do you mean? What kind of popup error and how is the PID wrong?

 

err.jpg

 

$pid = Run("C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe"")
MsgBox(64, "C:\Program Files (x86)\MSI Afterburner\MSIAfterburner.exe" pid:", $pid)

$pid = Run("notepad.exe")
MsgBox(64, "notepad.exe pid:", $pid)

$pid = Run("doesntexist.exe")
MsgBox(64, "doesntexist.exe pid:", $pid)

 

Edited by zYx
Link to comment
Share on other sites

  • Moderators

You have double, double quotes on the end of your run command. The error message is telling you just what is wrong.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

edited above as you posted:

looks like your run command has a double set of "" at the end, but only one at the beginning.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

  • Moderators

@zYx I am assuming, in case someone should come upon this thread in a future search, you mean #RequireAdmin

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Try using "shellexecute" instead of "run".  Run is meant more for executables that you would open in the "run" prompt when you press "win key + R".  Kind of like Ipconfig,exe or something similar.  If you must run the application using the "run" command, precede it with the @Comspec macro to call the command prompt to open the file.  An example would be as follows:

Run ( @comspec & " /c yourexecutablefile.exe", "Path_to_directory_containing_executable" )

Link to comment
Share on other sites

19 hours ago, JLogan3o13 said:

 

@zYx I am assuming, in case someone should come upon this thread in a future search, you mean #RequireAdmin

 

Sorry, yes :/ I corrected it now.

17 hours ago, MattHiggs said:

Try using "shellexecute" instead of "run".  Run is meant more for executables that you would open in the "run" prompt when you press "win key + R".  Kind of like Ipconfig,exe or something similar.  If you must run the application using the "run" command, precede it with the @Comspec macro to call the command prompt to open the file.  An example would be as follows:

Run ( @comspec & " /c yourexecutablefile.exe", "Path_to_directory_containing_executable" )

Thanks, I will use this at some point in future, I'm sure :]

 

Edited by zYx
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...