Sign in to follow this  
Followers 0
mikkokh

What is wrong?

6 posts in this topic

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 -

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

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 -

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 -

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