Windows job prompts encapsulated in double quotes with spaces are not passed correctly.
search cancel

Windows job prompts encapsulated in double quotes with spaces are not passed correctly.

book

Article ID: 270163

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

When passing a prompt  that includes spaces on a windows job, the following behavior can be seen even when the prompt value is encapsulated in double quotes...

D:\Automic\c\ntspawn "D:\Program Files\Microsoft SQL Server\sample\Binn\sqlcmd.EXE -TEST-Ppassword -12234 -b -Example -ipr798368.bat -oA798368.lis -b -w 255"
DEBUG is False
NO ENV ARGUMENTS
Argument String Array Length = 2
Argument[0] = D:\Program
Error  System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified

As noted the path D:\Program Files\Microsoft SQL Server\sample\Binn\sqlcmd.EXE is truncated to  D:\Program when processed through ntspawn

Environment

AM 9.4.x

Cause

This issue appears to be caused by behavior ntspawn behavior documented in (AM-3007). When prompt value is encapsulated within double quotes ntspawn splits the string incorrectly.

Resolution

The issue has been resolved in Applications Manager 9.5 ntspawn as noted below....

"preserve nested double quotes. Process the command line string directly and not rely on the args passed to the main method"

Alternative workaround to upgrading is to provide the 9.4 customer's with the 9.5 ntspawn.exe