Jump to content

Recommended Posts

Posted

I have this code to run WebMon with global settingfile. Normaly it use user homedirectory and i have many profiles in my computer, so it is not best option for me.

Dim $exePath, $dataFolder, $exeArgs
$exePath = "C:\Program Files\WebMon\webmon.exe"
$dataFolder = "D:\Additional File Storage For Programs\WebMon\Current"
$exeArgs = "-prefs " & FileGetShortName($dataFolder & "\Prefs.ini") & " -pages " & FileGetShortName($dataFolder & "\WebPages.dat")

Run(FileGetShortName($exePath) & " " & $exeArgs, "", @SW_MINIMIZE)

But, why program (webmon.exe) does not run in Minimized mode? I know that it work also that way, begause i have been same script in CMD Batch File and it work like it should be - if that opening DOS woindow does not bother...

OS: Win XP Pro [Finnish], SP2

- miXza-81 -

Posted

I have this code to run WebMon with global settingfile. Normaly it use user homedirectory and i have many profiles in my computer, so it is not best option for me.

Dim $exePath, $dataFolder, $exeArgs
$exePath = "C:\Program Files\WebMon\webmon.exe"
$dataFolder = "D:\Additional File Storage For Programs\WebMon\Current"
$exeArgs = "-prefs " & FileGetShortName($dataFolder & "\Prefs.ini") & " -pages " & FileGetShortName($dataFolder & "\WebPages.dat")

Run(FileGetShortName($exePath) & " " & $exeArgs, "", @SW_MINIMIZE)

But, why program (webmon.exe) does not run in Minimized mode? I know that it work also that way, begause i have been same script in CMD Batch File and it work like it should be - if that opening DOS woindow does not bother...

OS: Win XP Pro [Finnish], SP2

Try this:

Dim $exePath, $dataFolder, $exeArgs, $exeName
$exePath = "C:\Program Files\WebMon\"
$exeName = "webmon.exe"
$dataFolder = "D:\Additional File Storage For Programs\WebMon\Current"
$exeArgs = "-prefs " & FileGetShortName($dataFolder & "\Prefs.ini") & " -pages " & FileGetShortName($dataFolder & "\WebPages.dat")

Run(FileGetShortName($exePath&$exeName) & " " & $exeArgs, $exePath, @SW_MINIMIZE)
Posted

Try this:

Dim $exePath, $dataFolder, $exeArgs, $exeName
$exePath = "C:\Program Files\WebMon\"
$exeName = "webmon.exe"
$dataFolder = "D:\Additional File Storage For Programs\WebMon\Current"
$exeArgs = "-prefs " & FileGetShortName($dataFolder & "\Prefs.ini") & " -pages " & FileGetShortName($dataFolder & "\WebPages.dat")

Run(FileGetShortName($exePath&$exeName) & " " & $exeArgs, $exePath, @SW_MINIMIZE)
Still same result...

This CMD Batch code works:

set _WebMonDataDir_="D:\Additional File Storage For Programs\WebMon\Current"
start /min /dC:\Progra~1\WebMon webmon.exe -prefs %_WebMonDataDir_%\Prefs.ini -pages %_WebMonDataDir_%\WebPages.dat"
set _WebMonDataDir_=

So, why AutoIt 3 code not work?

This is weird.

Thanks.

- miXza-81 -

Posted

Still same result...

This CMD Batch code works:

set _WebMonDataDir_="D:\Additional File Storage For Programs\WebMon\Current"
start /min /dC:\Progra~1\WebMon webmon.exe -prefs %_WebMonDataDir_%\Prefs.ini -pages %_WebMonDataDir_%\WebPages.dat"
set _WebMonDataDir_=

So, why AutoIt 3 code not work?

This is weird.

Thanks.

The batchfile uses "Start" with the switch /Min

For some reason it seems to ignore the $SW_Minimized in your script,

you could launch it and then

WinWait("webmon") or whatever the title is

And then use winsetstate to minimize it

Posted

The batchfile uses "Start" with the switch /Min

For some reason it seems to ignore the $SW_Minimized in your script,

you could launch it and then

WinWait("webmon") or whatever the title is

And then use winsetstate to minimize it

That's works. Thanks.

- miXza-81 -

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
×
×
  • Create New...