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"
Related
I am trying to write a batch script which, once complete, would allow the user to continue using the Windows command prompt as they normally would had no script been run. Is this possible? Thank you in advance for any help.
If you manually open CMD (the Command Prompt) and invoke the batch file by name, CMD will remain open for additional commands after the batch file completes. You cannot do this by double-clicking on the batch file, but if you create a shortcut to the batch file that runs CMD.EXE with the /K switch, you will run the batch file and then leave CMD running for additional commands. See CMD at SS64.
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:
I'm creating a batch file which will open windows command prompt and from there it will open another shell(windchill shell). There I have to execute a command which will do some operations.
#echo off
start cmd.exe /k "cd D:\PTC\Windchill\bin & windchill shell"
Above script is opening windchill shell but I couldn't find a way to execute commands on it. I do not have much experience in this. Looking for some help.
Thanks in advance
This must be a real dumb question. And I cant figure out how.
What I want to do is launch a new command line with some arguments and excute some commands there.
Here is what I have in my .cmd
CMD /k %EnvInstallPath% %wo% %var%
cd /d %wo%\src
When I execute test.cmd, I see that the directory changes to %wo%, but the further cd src is not executed. I need to cd to a directory and execute few other commands.
When you run cmd with /k the console runs the command and then resumes with the prompt. I'm guessing that what you want is to run the command and resume with the next one, so you need to run cmd with /c instead.
put the other commands in a different bat file and
start AFewOtherCommands.bat
When I execute a .bat script from bash in Cygwin, by what mechanism is it running? I understand that if I run a .EXE it will launch, regardless of whether the .EXE is from Cygwin or from a more traditional environment. I understand that when I execute an executable script with #! at the beginning that Cygwin supplies the magic for it to run.
But why does a .bat script work? Is there some component inside of Cygwin that is aware of what a Windows .bat script is and what to do with it? Or is it that it is somehow impossible under Windows to execute a call to launch a .EXE file that won't automatically also work for a .bat script instead?
Running
./test.bat params
from bash seems to be equivalent to
cmd /c test.bat params
I believe that bash in cygwin sees the bat extension as being flagged executable (a cygwin hit-tip to windows convention). As such it loads and executes the file with it's associated interpreter (cmd.exe, per os configuration), much as it creates a new instance of bash to run your #! scripts (per posix standard).
And if you want to fork an *.cmd file execution like a ShellScript process and append his log to an file:
cmd /c test.bat > nohup.out &
Enjoy!