SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


using "pushd" from Job using CmdExec


using "pushd" from Job using CmdExec

Author
Message
cafescott
cafescott
Old Hand
Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)

Group: General Forum Members
Points: 398 Visits: 733
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!
cafescott
cafescott
Old Hand
Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)Old Hand (398 reputation)

Group: General Forum Members
Points: 398 Visits: 733
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,
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search