Skip to Content

script run to open an application

hi guys I have a script which runs fine from command line and by creating .bat files as well.. but when I am running same script from dataservices, it is not doing anything, kept running..

script needs to open the Snap11.exe and download the data and close the Snap11.exe.

see the script below:-

.bat file

@echo off
start cmd.exe /c F:\Snap_11\Snap11.exe /S "test1.mdf" /IR && timeout 5 && "F:\Snap_11\Snap11.exe" /S "test1.mdf" /DB "test2"

cmd script

F:\Snap_11\Snap11.exe /S "test1.mdf" /IR && timeout 5 && "F:\Snap_11\Snap11.exe" /S "test1.mdf" /DB "test2"

data services script:-

exec('cmd', 'F:\\Snap_11\\Snap11.exe /S "test1.mdf" /IR && timeout 5 && "F:\\Snap_11\\Snap11.exe" /S "test1.mdf" /DB "test2"');

please help me to find an error.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jul 20, 2017 at 03:17 PM

    Any help please..

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 20, 2017 at 06:18 PM

    Hi leo dec,

    Use print before exec function to see the error in the log. like print(exec()).

    try creating a .bat file wit your command and try calling the bat file in the exec function like below.

    exec('cmd', 'C:\test.bat', 8)

    Thanks,

    Ravi kiran.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 21, 2017 at 08:18 AM

    Hi Ravi

    I tried executing the .bat file as per your instructions, but nothing happens, job gets stuck and after aborting the job manually no error shown in error log file in management console..

    same result if I use print before exec function as well

    regards

    Add comment
    10|10000 characters needed characters exceeded