Issue in running an exe file thru Bigfix which works fine thru cmd

(imported topic written by VS6591)

Hi,

I am running a bat (Repointer.bat) file which has just a single line - RepointerUI.exe /s /i “srps.xml”.

RepointerUI.exe - It gets certain values from srps.xml. So I am passing this as a parameter. If not given, it will prompt us to enter the values.

If I execute the bat file through Command Prompt, it works fine (without prompting for any values)

If I execute the same bat file through Bigfix, it is not working (The bat file is not actually getting executed and the status in the BigFix is not changing from “running” to “completed”)

I tried running the RepointerUI.exe through BigFix with the command - (wait “C:\RepointerUI.exe” /s /i “srps.xml”)

Please help me in finding out what could be the problem.

(imported comment written by Supanono91)

try to see the log on the client , it will help you to know were is the blocking point.

(imported comment written by MattBoyd)

Here’s a few things that you can try:

  • Specify the full path to srps.xml
  • Try using ‘dos’ instead of ‘wait’

(imported comment written by VS6591)

I tried using dos

dos “C:\RepointerUI.exe” /s /i “C:\srps.xml” as well as dos “Repointer.bat”

The status shows “completed” but the changes are not reflected which means the exe is not executed.

Since the status is completed, the log shows “command succeeded” so I could not figure out the problem.

(imported comment written by BenKus)

Does your batch file use relative paths?

See http://forum.bigfix.com/viewtopic.php?id=4671 for a similar issue and how to fix it…

Ben

(imported comment written by VS6591)

No. It doesnot use any relative paths. Both the files are in “C:”

The exe is a windows application (C#.net). I created another windows application and executed it in the same way (silent mode), again the same problem. Should I execute the windows application in a different way then?

(imported comment written by BenKus)

This command should be the BigFix equivalent to running it yourself:

waithidden cmd.exe /C “C:\RepointerUI.exe” /s /i “C:\srps.xml”

If that doesn’t work, it might be a SYSTEM account issue with this application… you might want to investigate this area: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=484

Ben

(imported comment written by VS6591)

Hi Ben,

I tried that (given in the link), after entering the command it gives the message “Added new job with JOB ID = 1” but doesn’t pop up any window. I even ran AT command, it says “Today” only. Does it mean it has SYSTEM account issue?

Thanks,

VS

(imported comment written by BenKus)

What OS are you testing on?

Ben

(imported comment written by VS6591)

Windows Server 2003

(imported comment written by BenKus)

Hi VS,

At this point, I am not sure… The application appears to be executing properly and after the application launches, it is just like any other application that you launch. The only difference that I can think of is that the Agent launches it as the SYSTEM account and so I recommend troubleshooting whether your application can’t run as the SYSTEM account.

You alternately might try using the “RunAsCurrentUser” tool: http://support.bigfix.com/cgi-bin/kbdirect.pl?id=392

Ben

(imported comment written by VS6591)

Hi Ben,

Thanks for the link. But due to some restrictions, I could not use the utility.

Is there any way to pass the username and password in the action scripts e.g. “-u “us\abcd” -p “XXXX”” to run the exe?

Thanks,

VS

(imported comment written by BenKus)

You can use tools built into Windows to do that, but there isn’t a way to securely distribute the password…

I think the runascurrentuser is definitely something to try to address this issue…

Ben

(imported comment written by VS6591)

Hi Ben,

Finally I could resolve the issue. It’s something with the application I am executing. The application inturn accesses an external file which is in the same location as the application (say C:\Program files\RepointerTool").

Instead of running wait “C:\program files\Repointer tool\Repointer.bat”

if i do

dos cd “C:\program files\Repointer tool”

wait “C:\program files\Repointer tool\Repointer.bat” .it works fine. otherwise the application could not find the exteranl file.

Thanks for your continuous help.

I will get back to you, if I face any other problems :slight_smile: