cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aghorn
Level 2

Execute Command, Execute Script/Batch file actions not executing

I am having problems with the Execute Command and Execute Script/Batch file actions. Neither appear to execute during the installation even when I try a simple function like making a directory. I am using IA 2008 Enterprise and installing on Windows Vista (user account control turned off).

For example, say I want to make a directory called aghornTemp in the installed directory. With Execute Command I put in:

mkdir aghornTemp

With Execute Script/Batch file, I've tried

mkdir aghornTemp

and also created a batch file with the above being the only command. And also doing the following like someone earlier in this forum suggested:

call "$USER_INSTALL_DIR$$/$make_aghornTemp.bat

Nothing works. My developer partner is experiencing the same problems, and she is installing on Windows XP.

Are we missing something here? I thought that these IA actions would be pretty straightforward.
Labels (1)
0 Kudos
(6) Replies
pv7721
Level 20

There's a trick here. If you're executing "internal" commands, you need to actually Execute the commander interpreter, and not directly the command itself, for instance:

CMD /C RD /S /Q "$USER_INSTALL_DIR$$/$tmp$/$"


So you execute the cmd with the command execution setting, and the command is the Windows rm -rf equivalent...

The trick is also in quoting (in case, and it's often the case on Windows, your installation dire contains spaces you need to quote them, but just around the dir, not the whole command...
0 Kudos
TheTraveler
Level 8

pv7721 is correct. When you run or launch a batch file from LaunchAppAndWait, the process you are opening is not running in a dos shell. So the interpretation layer isn't running. When you run your batch file under CMD, it loads that interpretation and your batch file will be able to run.
0 Kudos
aghorn
Level 2

Thanks very much for the help. Was never much of a DOS/CMD batch file writer either. So this helps. Was able to do my simple make directory command. Working on a more involved batch file which isn't working yet but investigating at the moment.
0 Kudos
chmahmood
Level 3

hi,

I have an issue with Execute Script/Batch File. I have write a simple script to copy file from one location to another location in batch file and when i use this script directly it working properly but when I use this .bat through InstallyAnywhere Execute Script/Batch File action my .bat file does not execute.

I have writing a this statement to script text field to invoke dllcopy.bat file which is exists in installed folder

CMD /C RD /S /Q "$USER_INSTALL_DIR$$/$dllcopy.bat"

InstallAnywhere log show .bat file is successfully executed but actually .bat file not executed and file didn't copy so what was the mistake which is made my me.
0 Kudos
pv7721
Level 20

I've answered to the new thread you've created here: http://community.flexerasoftware.com/showthread.php?t=199743
0 Kudos
phanikumarg
Level 4

im following below systax in script/batch action but it is not working

cmd.exe /c @echo off
cmd.exe /c ping 127.0.0.1 -n 10 > nul
cmd.exe /c shutdown /r /t 0 /d P:4:2


can some pls help me
0 Kudos