ecirbaf29 Posted December 7, 2006 Share Posted December 7, 2006 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 Link to comment Share on other sites More sharing options...
The Kandie Man Posted December 7, 2006 Share Posted December 7, 2006 (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 December 7, 2006 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 Link to comment Share on other sites More sharing options...
jpm Posted December 7, 2006 Share Posted December 7, 2006 you can have @comspec working if you use the "start"run(@comspec & ' /c start "" "' & @ProgramFilesDir & '\autoIt3\AutoIt.chm"',"",@SW_HIDE) Link to comment Share on other sites More sharing options...
ecirbaf29 Posted December 7, 2006 Author Share Posted December 7, 2006 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!!! Link to comment Share on other sites More sharing options...
jpm Posted December 7, 2006 Share Posted December 7, 2006 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 Link to comment Share on other sites More sharing options...
MHz Posted December 7, 2006 Share Posted December 7, 2006 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. Link to comment Share on other sites More sharing options...
ecirbaf29 Posted December 7, 2006 Author Share Posted December 7, 2006 (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 December 7, 2006 by ecirbaf29 Link to comment Share on other sites More sharing options...
Joon Posted December 7, 2006 Share Posted December 7, 2006 (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 December 7, 2006 by Joon Link to comment Share on other sites More sharing options...
ecirbaf29 Posted December 8, 2006 Author Share Posted December 8, 2006 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!!!! Link to comment Share on other sites More sharing options...
GEOSoft Posted December 8, 2006 Share Posted December 8, 2006 (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.ExampleCODEShellExecute(<folder path> & "\My_File.chm" Edited December 8, 2006 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!" Link to comment Share on other sites More sharing options...
jpm Posted December 8, 2006 Share Posted December 8, 2006 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? Link to comment Share on other sites More sharing options...
The Kandie Man Posted December 8, 2006 Share Posted December 8, 2006 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 Link to comment Share on other sites More sharing options...
Joon Posted December 9, 2006 Share Posted December 9, 2006 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... Link to comment Share on other sites More sharing options...
ecirbaf29 Posted December 11, 2006 Author Share Posted December 11, 2006 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. Link to comment Share on other sites More sharing options...
masvil Posted January 10, 2007 Share Posted January 10, 2007 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? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now