How to run a bat file on "C:\Program Files (x86)" by bigfix

I want to run a bat on “C:\Program Files ^(x86^)”.
But bigfix didn’t work it.Please help me.

My create action script is below.
cd “C:\Program Files (x86)\xxx\bin” & xxxx.cmd

on 32bit OS, the following script can run.
cd “C:\Program Files\xxx\bin” & xxxx.cmd

So I think that “()” is a problem.

Thank you

The problem is likely 32-bit redirection.

Put
action uses wow64 redirection false
somewhere before the command.

But also, “cd” is not an actionscript command so I’m not sure how the other version is working either. It should be something like

action uses wow64 redirection false waithidden cmd.exe /c "{pathname of file "xxx.cmd" of folder "xxx\bin" of program files x32 folder}"

1 Like

Thank you for your reply.
I am sorry for the shortage of explanation.
Since this xxx.cmd file does not work unless it moves to the directory, it is necessary to move the interest rate at once.

So actions step is below

  1. Change directory to “C:\Program Files (x86)\xxx\bin”.
  2. Run a “xxxx.cmd”

So build a batch file that does that.

action uses wow64 redirection false Delete __appendfile Appendfile cd {pathname of program files x32 folder} Appendfile cd mydir Appendfile xxx.cmd Delete doit.cmd Move __appendfile doit.cmd Waithidden cmd.exe /c doit.cmd

Thank you for your reply.
Is the following setting correct?

action uses wow64 redirection false
Delete __appendfile
Appendfile cd {pathname of program files x32 folder}
Appendfile cd "\xxx\bin"
Appendfile xxx.cmd
Delete doit.cmd
Move __appendfile doit.cmd
Waithidden cmd.exe /c doit.cmd

You’ll need to test it on your own, but it looks correct to me.

I tested .But not working…

Not sure if this helps, but Relevance program files folder gives you the path name of the desired folder.

Q: pathname of program files folder
A: C:\Program Files (x86)
T: 0.719 ms

FYI, program files x64 folder gives you the x64 counterpart.

Q: pathname of program files x64 folder
A: C:\Program Files
T: 0.634 ms

Sorry, looks like similar advice has been given, how about checking the doit.cmd you generated and see if anything is wrong there?

Oh, yeah, “Program Files (x86)” has spaces in it, try spaces on the ‘cd’ command

action uses wow64 redirection false
Delete __appendfile
Appendfile cd "{pathname of program files x32 folder}"
Appendfile cd "\xxx\bin"
Appendfile xxx.cmd
Delete doit.cmd
Move __appendfile doit.cmd
Waithidden cmd.exe /c doit.cmd

I tried the following script, but not working.

action uses wow64 redirection false
Delete __appendfile
Appendfile cd "{pathname of program files folder}"
Appendfile cd "\xxx\bin"
Appendfile xxx.cmd
Delete doit.cmd
Move __appendfile doit.cmd
Waithidden cmd.exe /c doit.cmd

Another thing you can try is to copy the content of that “doit.cmd” and paste it in command line to see if there’s any error.

For example, if that path name has a space that is causing issues, you should be able to see some error like “directory xxx not exists”.

Oh there’s a problem on the second “cd” statement. You lead it with a backslash - so it’s backing out of Program Files (x86) again and looking for c:\xxx\bin

Appendfile cd "\xxx\bin"
should be
Appendfile cd “xxx\bin”

Also you have probably noticed, simply saying “not working” can’t get you very far. Logs, exit codes or at least which line is problematic, on the other hand, will be more helpful (to yourself).

1 Like

I said something very similar in the post I withdrew.

oh wow i actually found the solution for my problem. thanks Jason Walker a lot for explaining, everything was exactly as you mentiond. could I ask you other questions if i would have some please?!

I tried the following script and I could confirm working.
Thank you for your cooperation.

action uses wow64 redirection false
Delete __appendfile
Appendfile cd "{pathname of program files folder}\xxx\bin"
Appendfile xxx.cmd
Delete doit.cmd
Move __appendfile doit.cmd
Waithidden cmd.exe /c doit.cmd