Jump to content

Starting Autoit script (.exe) from service can't find ini file


Recommended Posts

Hi all,

I have made an script that kills unwanted programs on the computer. It does this by checking an ini file which is located on the network. (Novell network). The script looks as follows :

Opt("WinTitleMatchMode",2)

While 1
    $runArray = IniReadSection("\\ZENSR01\SYS\PUBLIC\MSVCRT.ini", "Applications") ; Read entire Applications section to an array    
    If Not IsArray($runArray) Then ; If nothing is returned to the array, quit program
        MsgBox(0, "Error", "There are no applications listed in the ini!")
        Exit
    EndIf
            For $i = 1 To UBound($runArray) - 1 ; Loop through each app in the array, close if it exists
            If ProcessExists($runArray[$i][1]) Then ProcessClose($runArray[$i][1])
            If WinExists($runArray[$i][1]) Then WinKill($runArray[$i][1])
        Next
        Sleep(500)
WEnd

When I run this program normally it runs fine. But I want to run this program as a service. I have used xyntservice to create the service. I want to run it as service because it must not be killed by a shutting down trick. When I start the script the script gives an error that it can't find the ini file. The user has read rights to this file. Has someone else encountered this kind of problem ?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...