execute some script after compile - lazarus

i wanna to copy some file after lazarus compiled my project, like Build event in visual studio, I found the similar option in Lazarus:
but when I press ctrl+f9 to compie, will thrown error:
Executing command after missing executable ""

As I read the documentation, you are expected to provide an executable command. A .bat file is not executable which would explain why your command fails.
Prepend your command with cmd.exe /c to provide the executable which processes the .bat file.
cmd.exe /c "G:\Lazarus project\dll test\copy.bat"

change the command to cmd.exe /c "G:\Lazarus project\dll test\copy.bat" will works:

Related

Shell script execution in ssis

I have a file with extention .sh(shell script).
I need execute this file in ssis using execute process task.
how can i do this.
Please help me!!!
Code inside .sh file :echo SSIS test >> /home/junaib/test/sql.txt (for testing)
If you enabled WSL and you sure that the commands work from command line then you can run the command on cmd.exe with the /c flag
Executable : cmd.exe
Arguments : /c "BASH C:\SO\test.sh"

keep cmd after execution of a .exe file open

I am trying to run the .exe of a programm I donwloaded. But to see why it isn`t working I want to keep the cmd open to see the output it generates. Is that somehow possible?
Use the /K switch: cmd /K "my.exe".

How can I run a batch script in 'Deployment Tools Command Prompt' (to make WinPE iso)?

I want to run a batch script inside of the deployment tools command prompt (part of the Windows AIK) to create a WinPE iso. I went through the steps to prep the media and created a script to navigate to the right directory and then run the oscdimg.exe tool.
The problem is that it runs in a normal command prompt, not the deployment tools command prompt. Is it possible to write a script that will run in the deployment tools command prompt instead of the regular command prompt?
My basic script:
#echo off
#echo Running OSCDIMG to create a WinPE amd64 iso in f:\OtherItems\view_stores\WinPE7\winpe.iso
f:
cd \OtherItems\view_stores\WinPE7
oscdimg.exe -n -bf:\OtherItems\view_stores\WinPE7\etfsboot.com f:\OtherItems\view_stores\WinPE7\ISO f:\OtherItems\view_stores\WinPE7\winpe.iso
#echo **********************************************************************
#echo Done.
#echo
pause
If you look at the Properties of 'Deployment Tools Command Prompt' the target is:
C:\Windows\System32\cmd.exe /k "C:\Program Files\Windows AIK\Tools\PETools\pesetenv.cmd"
So it's not a separate program, it's a batch run in the regular cmd prompt.
You can take the content of "pesetenv.cmd" and use it as a prefix to your batch:
Now the Deployment Tools commands should work as expected.
EDIT:
Scratch the above, I don't know why I thought that was doing something. Adding the full path to oscdimg.exe and imagex.exe is what works for me.
C:\Program Files\Windows AIK\Tools\x86\oscdimg.exe -n -bf:\OtherItems\view_stores\WinPE7\etfsboot.com f:\OtherItems\view_stores\WinPE7\ISO f:\OtherItems\view_stores\WinPE7\winpe.iso

How to Make a .bat file with arguments

For my work I have to run a string in "run".
I want to make this in a bat file but the arguments are not used but without them the program will not run.
This is the string:
"C:\Program files (x86)\MicroTouch\MT7\TwUI.exe" TwUICP.dll CPMain
Can someone help me with this problem?
You can simply put the same line of code into your bat file:
"C:\Program files (x86)\MicroTouch\MT7\TwUI.exe" TwUICP.dll CPMain
There are some options you can use. For example if you want the program to run hidden in background you can add start /b before the line. start /w will make the cmd window stay open and wait for your program to finish. You can even definde which CPU cores the program should use. For more information open the console and type start /? or check out http://ss64.com/nt/start.html.
Have the same problem, same software i think...
"C:\Program Files (x86)\MicroTouch\MT 7\TwUI.exe" twuicp.dll CPMain
Running that line through task manager -> new task will open a tool to configure touch-screen options, calibrate, etc...
Well same line doesnt work in a bat or cmd file. If i try to launch this tool through cmd.exe it doesnt work either.
The answer is always the same:
USAGE: twui <DLL name> <UI symbol name>
This works, but same line in cmd.exe dont

Run an input file using an exe file with cmd

I am using Windows 7
How can i run an input file (text file of commands) in an exe progam in CMD please.
Using other questions on the site, i have tried:
CMD /c ""C:/Program Files/Mplus/Mpluswin.exe" "C:/Users/jj/Desktop/mplus/test_mplus.inp""
which opens the input file in the program but does not run it
and this, which opens the program, but not the script
CMD /c "C:/Program Files/Mplus/Mpluswin.exe" < "C:/Users/jj/Desktop/mplus/test_mplus.inp"
Does this depend on the exe program?
Edit:
At present, the first command above launches the exe program and opens the text file within it (this is a file of program specific commands that will read in data, run calculations and output automatically). I can then run the commands in the exe program that has been opened (by selecting run in a menu) . But, I would like to pass the file to the exe program and it to be run automatically, ideally in the background. I am not sure of the correct terminology to use, so sorry if my description is unclear.
I've just noticed that you enclosed the entire term in an extra set of double quotes, and used linux forward slashes - try this batch file and also see if there is any error message on the console.
#echo off
cd /d "%userprofile%\Desktop\mplus"
"C:\Program Files\Mplus\Mpluswin.exe" "test_mplus.inp"
echo mplus was launched
pause

Resources