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


running command line in DTS package


running command line in DTS package

Author
Message
jamie.lawrence
jamie.lawrence
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 181
Hi, i have a csv file that i run through an EXE application. i need to be able to run this as part of a DTS execute process task but i cant get the command line to work. can any one please help.
this is the command line code i use in cmd.exe

@echo off
C:
cd "Program Files\HSCIC\C:\Program Files\HSCIC\HRG4 2013_14 LP Grouper"
HRGGrouper
-i ”K:\Reports\HRG_Grouper\ HRG_Grouper_Input.csv”
-o ”K:\Reports\HRG_Grouper\HRG_Grouper_Output1.csv”
-d ”C:\Program Files\HSCIC\HRG4 2013_14 LP Grouper\HRG4_sample_NAC.rdf”
-l ”C:\Program Files\HSCIC\HRG4 2013_14 LP Grouperap_v46lp.tre”
-h -t -p
IF %ERRORLEVEL% NEQ 0 echo Error in command, please check hrg.log
Pause

Thanks
James
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8780 Visits: 3718
What have you tried so far? What are the errors you encountered?

I think if you add a "Execute Process Task" to your package, you should be able to get it. You have to remove all extra commands (like "@Echo off", "IF..." and "pause") you have in the batch file. Just enter the executable and enter the arguments.
Or you can try to call the batchfile itself from the DTS package.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
jamie.lawrence
jamie.lawrence
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 181
Thanks.
i have been enetering the following in my batch file in the Win32Process: field of the execute process task

C:
cd "Program Files\HSCIC\#grouperFolderName#"
HRGGrouper
–I”K:\Reports\HRG_Grouper\ HRG_Grouper_Input.csv”
–o” K:\Reports\HRG_Grouper\HRG_Grouper_Output.csv”
–d” C:\Program Files\HSCIC\HRG4 2013_14 LP Grouper\HRG4_sample_NAC.rdf”
–l” C:\Program Files\HSCIC\HRG4 2013_14 LP Grouperap_v46lp.tre”

but i get an error that does not tell you a lot, just that it failed
jamie.lawrence
jamie.lawrence
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 181
i see my error. i have entered the correct path of the exe but when i execute the process all that happend is that the exe opens. it seems to ignore my parameter values

J
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8780 Visits: 3718
Will it succeed if you enter the drive, path and executable as a single line (i.e. "C:\Program Files\HSCIC\#grouperFolderName#\HRGGrouper.exe") in the executable field and the rest in the arguments field?

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8780 Visits: 3718
jamie.lawrence (8/16/2013)
i see my error. i have entered the correct path of the exe but when i execute the process all that happend is that the exe opens. it seems to ignore my parameter values

J

What if you enter both the executable and all arguments as a single line in the executable field?

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
jamie.lawrence
jamie.lawrence
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 181
no, it just launches the exe but ignores the input, output ect parameters.
Thanks for your help
HanShi
HanShi
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8780 Visits: 3718
First: I am using SQL 2008 and not SQL 2000, so maybe it's not representative.

Do determine if the combination of the executable and the arguments field work correctly, I have created a new package and added a "Execute Process Task". I've enter "C:\Windows\Notepad.exe" as the executable and entered the filename (incl. full path) of a text file as argument.
I was able to execute the package (debugging modes) ant it started notepad with the file I entered in the argument field.

Can you try and see if above scenario succeeds in your situation?

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
jamie.lawrence
jamie.lawrence
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 181
Yes, that worked for me.
i wonder if the fact that i have to press a button in the exe stops it from working automatically
Thanks again for help
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