Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

using "pushd" from Job using CmdExec Expand / Collapse
Author
Message
Posted Wednesday, May 8, 2013 8:19 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, December 8, 2014 6:20 AM
Points: 162, Visits: 723
Hello,

For months I've been trying to run a job (using the SQL Server Service Account) that calls a batch file on a remote server which in turn calls Gpg4win to encrypt a file. (I have been putting the project down and picking it up.)

I haven't been able to get the job to call a SSIS package that calls the batch file (using an Execute Process task) under the Service Account credentials. The job always hangs. (I'm pretty sure there is no "Y/N" dialogue that is holding things up. When I run under my credentials, no dialogue box appears.)

In an effort to get something to work, I've been trying to create a job under the Service Account that calls the CmdExec. I have managed to get the service account to create a test file with this DOS instruction:
dir "\\myServer\myShare\*.csv" > "\\myServer\myShare\Test_file.txt"

Believe me, I was happy to see the Service Account actually do something.

Now I wish to expand the process like so:
pushd "\\myServer\myShare\"
dir *.csv > Test_file.txt
popd

However, the CmdExec for SQL jobs doesn't appear to do anything with "pushd" or "popd". When I execute the commands directly above the CmdExec job succeeds, but I have no idea where the output file went. It isn't on the remote server (i.e., \\myServer).

Does anyone know how to get a job running the CmdExec to change the current directory to a remote server? All help appreciated. Thanks!
Post #1450599
Posted Wednesday, May 8, 2013 8:46 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, December 8, 2014 6:20 AM
Points: 162, Visits: 723
Where I wrote:

"I haven't been able to get the job to call a SSIS package that calls the batch file (using an Execute Process task) under the Service Account credentials. The job always hangs."

What I should have said is that I have reduced the batch file that the SQL Server Service Account is attempting to run to just these lines:
pushd "\\myServer\myShare"
dir *.csv > Test_file.txt
popd

Even with the batch file reduced to just this, the job hangs when calling a package that calls this batch file using the Execute Process task, using the Service Account's credentials.

I wish it were easier to fix permissions issues using the SQL Server Service Account in SQL Server.

Thanks,
Post #1450619
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse