zrag Posted October 16, 2009 Share Posted October 16, 2009 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 Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 16, 2009 Share Posted October 16, 2009 (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 October 16, 2009 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
zrag Posted October 16, 2009 Author Share Posted October 16, 2009 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. 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