Link to home
Start Free TrialLog in
Avatar of Gopi K
Gopi K

asked on

Batch File hang and continuously running through SQL Job

Hi Guys,

We have created one VBS file to convert the Excel file to CSV format and the given VBS file is being executed through Batch file.The batch file executes with the heop of SSIS Execute Process Task. Everything works fine through SSDT/BIDS but the package is getting hanged continuously if we try to run through SQL Job.

These are the code

 Batch File :
wscript S:\Batch\vbsExceltoCSV.vbs S:\Batch\Client_200817.xlsx S:\Batch\Client_200817.csv

VBS:
Set objArgs = WScript.Arguments
InputName = objArgs(0)
OutputName = objArgs(1)
Set objExcel = CreateObject("Excel.application")
objExcel.application.visible=false
objExcel.application.displayalerts=false
set objExcelBook = objExcel.Workbooks.Open(InputName)
objExcelBook.SaveAs OutputName, -4158
objExcel.Application.Quit
objExcel.Quit

Even when I try to execute the batch file from SQL Job (CmdExec) , facing same issue.

I have tried with both Service and proxy account but no luck.

Could you please help me to identify what could be the issue.

Regards,
Gopi K
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Which version are you using 32bit/64 bit?

You also need to be sure that your batch command is not waiting for an input from you.?
Avatar of Gopi K
Gopi K

ASKER

Thanks for your comment. Excel is 32 bit version and I  have tried to execute them in 32 bit mode as well but no luck. I am executing the script using proxy account which has admin privileges.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.