Jump to content

Recommended Posts

Posted

Hi all,

So I'm not trying to do anything all that complicated. Just a basic RunAs administrator script, but I keep getting an error when trying to run it. Apparently there is an ini file that needs to be evoked for the program to run, but I'm not sure how to tie it into the script.

So my simple script is:

RunAs("Administrator", @ComputerName, "password", "0", "C:\Program Files\.....\File.exe")

When I run it, I get this message:

"The Initiation file, File.ini, could not be found. You have to have it in a current directory in order to be able to run reports."

The script is in the same folder as the exe and the ini. I guess I should be calling the ini file up at some point in the script, but I dont know how/where to do that.

Any ideas what I can do to get this to work???

Thanks in advance

Posted (edited)

Your application most likely check for the .ini file in the "working directory" which you haven't set in your RunAs() (sixth parameter). Set that to the folder the .ini file is in (probably where the .exe is) and it should work.

Edited by AdmiralAlkex
Posted

Your application most likely check for the .ini file in the "working directory" which you haven't set in your RunAs() (sixth parameter). Set that to the folder the .ini file is in (probably where the .exe is) and it should work.

Thanks so much. Adding that working directory path that worked like a charm.

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
×
×
  • Create New...