cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to get Data service exec command to work

Former Member

Been trying to get the command exec to work launching a vb script to work and still getting errors.

This is the error I receive. Can anyone explain what this error means?

Cannot create process with image file

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

What are you trying to exec? How does the script and exec look like?

Arun

Former Member
0 Kudos

I am trying to execute a vbscript file. I am using the command

The file path for the variable is correct as we have tested that idea already. the VB script file runs fine as I can execute it manually. Data services has full access to the file location as that is where all of it's other files are located.

$G_excute_file = exec('[$G_ENV_FILEPATH]File_Copy_To_Processing.vbs','',8);

Former Member
0 Kudos

You need to use CScript.exe to execute the script.  When running from the command interpreter it is automatically invoked.

Former Member
0 Kudos

It should be like exec('cscript','c:\\path\\xyz.vbs',8);

Arun

Former Member
0 Kudos

OK I got that method to work by. Creating a batch file and with

CScript.exe"\\SAPDS4DEV\SBOShare\DataFiles\Energy Cap\Source\File_Copy_To_Processing.vbs"

and calling $G_Successful_Filenames = exec('

\\SAPDS4DEV\SBOShare\DataFiles\Energy Cap\Source\

mybatch.bat,'',8')

I would like to skip the extra batch file and place all of the path in my exec like below. But when I do this I get an error... path cannot be found. I'm guessing I have the syntax wrong.

$G_Successful_Filenames = exec('CScript.exe //SAPDS4DEV/SBOShare/DataFiles/Energy Cap/Source/File_Copy_To_Processing.vbs','',8);

Former Member
0 Kudos

Also tried the syntax like this, but still get error.

$G_Successful_Filenames = exec('CScript.exe "\\\SAPDS4DEV\\SBOShare\\DataFiles\\Energy Cap\\Source\\File_Copy_To_Processing.vbs"','',8);

Former Member
0 Kudos

You have to put cscript in single quotes, path in single quotes then 8 without quotes.

Arun

Former Member
0 Kudos

Thank you all for your help.

Answers (1)

Answers (1)

mohan_salla
Participant
0 Kudos

Try this

$G_Successful_Filenames = exec('\\file location\file name',' ', 😎 .

Syntax is

exec(command_file, parameter_list, flag)

Mohan