NeilApp Posted August 19, 2008 Share Posted August 19, 2008 Hi guys, I've made a program that runs as a service, it works fine normally but when i start it as a service it manages to edit files but it doesnt create the two .inis (temp.ini and dates.ini) expandcollapse popup$replace = "INSTALL_FAILED" $with = "INSTALL_PENDING" $path = "C:\ini\" $replaced = 0 $rpackagesb = 0 $firstfile = FileFindFirstFile($path & "*.ini") if $firstfile = -1 Then Exit EndIf while 1 $file = FileFindNextFile($firstfile) if @error then ExitLoop EndIf $packages = IniReadSectionNames($path & $file) for $i1 = 1 to $packages[0] $packaged = iniReadSection($path & $file,$packages[$i1]) if @error Then ExitLoop EndIf for $i2 = 1 to $packaged[0][0] if $packaged[$i2][1]= $replace Then $dates = IniRead("dates.ini","packagesreplaced",$packaged[$i2][0],"Default") if $dates - @yday > 14 Then IniWrite("Broken packages.ini","package",$packaged[$i2][0],$dates) Else IniWrite($path & $file,$packages[$i1],$packaged[$i2][0],$with) IniWrite("dates.ini","packagesreplaced",$packaged[$i2][0],@YDAY) IniWrite("temp.ini","packagesreplaced",$packaged[$i2][0],@YDAY) EndIf EndIf Next Next WEnd FileClose($firstfile) Any ideas guys? Link to comment Share on other sites More sharing options...
Triblade Posted August 19, 2008 Share Posted August 19, 2008 (edited) AutoIt exe's can't be run as a service. Lots of posts about this. Search the forum. Edit: I read a bit to quick. You're saying you CAN run it as a service? Or is that with a third party program? And you sure $path isn't needed b4 "dates.ini" & "temp.ini" when you IniWrite them? Edited August 19, 2008 by Triblade My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
NeilApp Posted August 19, 2008 Author Share Posted August 19, 2008 There is a lot of threads saying how to run autoit scripts as a service, there is even an entry in the FAQ for how to do it. My exe does work but it just cant create the files for some reason, thats what im asking about. Link to comment Share on other sites More sharing options...
Triblade Posted August 19, 2008 Share Posted August 19, 2008 And my edit? My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) 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