Sign in to follow this  
Followers 0
ecirbaf29

Comspec do not open chm file when my script run as service

15 posts in this topic

Hi,

I am new member and i am french. So my english is limited.

I have a problem

Comspec do not open chm file when my script run as service.

I have made service with sercicecontrol.au3 and all is ok expect opening chm files.

anybody have idea?

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The Run() function can only run executable files, aka .exe, .bat, .pif, .com, etc.

A chm is not a executable file, so it doesn't know how to execute it. Instead, use the beta version of autoit and use the ShellExecute function:

ShellExecute ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] )

ShellExecute("AutoIt3.chm")
oÝ÷ Øò¢çhmÁ©í¶h¶­²)©'hjË!£  âØ^~e£§ìZ^jëh×6
Run(@WindowsDir & '\hh.exe "D:\Program Files (x86)\AutoIt3\AutoIt3.chm"')
Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

you can have @comspec working if you use the "start"

run(@comspec & ' /c start "" "' & @ProgramFilesDir & '\autoIt3\AutoIt.chm"',"",@SW_HIDE)
;)
Yes this is work when i run my script as user but do not work when i run my script as service!!!

Share this post


Link to post
Share on other sites

Yes this is work when i run my script as user but do not work when i run my script as service!!!

@comspec open a window so a session must be open.

I am not too familiar what can really be done with services even with ShellExecute ;)

Share this post


Link to post
Share on other sites

Yes this is work when i run my script as user but do not work when i run my script as service!!!

A service by default does not interact with a user desktop. There is an option that be enabled to allow interaction with the desktop in services.msc.

;)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

A service by default does not interact with a user desktop. There is an option that be enabled to allow interaction with the desktop in services.msc.

;)

my service is enabled to allow interaction with the desktop.

Edited by ecirbaf29

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

By default, service is running under SYSTEM account. Many things are act different under SYSTEM. Try to create a service running under user id other than local SYSTEM and test.

Edited by Joon

Share this post


Link to post
Share on other sites

By default, service is running under SYSTEM account. Many things are act different under SYSTEM. Try to create a service running under user id other than local SYSTEM and test.

But i want it run under SYSTEM account. It is ok if i run an exe but not for chm file!!!!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

But i want it run under SYSTEM account. It is ok if i run an exe but not for chm file!!!!

If an EXE file runs then I think ShellExecute() should work.

Example

CODE
ShellExecute(<folder path> & "\My_File.chm"
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

But i want it run under SYSTEM account. It is ok if i run an exe but not for chm file!!!!

Certainly the .exe does not open a .chm neither interact with the screen.

Can you confirm?

Share this post


Link to post
Share on other sites

If ShellExecute() doesn't work, feel free to use this program i just wrote and run the parameters to it. It should not have the same restrictions as a service since it isn't being run as a service.

This is a ShellExecute.exe I wrote in Freebasic that is 5KB and has a small documentation txt file and an example batch file:

ShellExecute.zip


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

But i want it run under SYSTEM account. It is ok if i run an exe but not for chm file!!!!

I just tested, you can not run CHM file with SYSTEM account. Running hh.exe test.chm won't open. There are things you can not do with SYSTEM account like.

Can't use UNC path or RunAs, etc...

Share this post


Link to post
Share on other sites

I just tested, you can not run CHM file with SYSTEM account. Running hh.exe test.chm won't open. There are things you can not do with SYSTEM account like.

Can't use UNC path or RunAs, etc...

Many thanks to every body reply. I go search another way to open my helpfile.

Share this post


Link to post
Share on other sites

There are things you can not do with SYSTEM account like.

Is there a way to run another script as current user from a script running as system?

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