on 2016 Aug 25 7:43 AM
Hi all,
Have created a script using PowerShell called script_unzip.ps1.
Can anyone pls help with the syntax to execute this in a BODS script.
I picture we have to use the exec() function, and I tried the below however it doesn't work. At times the job starts and gets stuck.
exec('cmd', '"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "\\path_path_path\script_unzip.ps1" -wait', 8);
All help will be appreciated.
Thank you.
-Sid
Request clarification before answering.
Hi ,
Exec() function executes the parameters by default in CMD, so there is no need to add cmd in arguments.
Write your code as you execute in CMD .
For ex: If I have to execute a bat file in cmd .
In system I go to cmd and then write the path .....C:\> (path)\filename.bat
so in DS the code will be
exec( '(path)\filename.bat','',8)
This will execute the file. similarly you can code for your requirement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.