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

running command line in DTS package Expand / Collapse
Author
Message
Posted Friday, August 16, 2013 2:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 6, Visits: 176
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
Post #1485015
Posted Friday, August 16, 2013 2:45 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 2,294, Visits: 2,754
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’! **
Post #1485035
Posted Friday, August 16, 2013 3:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 6, Visits: 176
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
Post #1485065
Posted Friday, August 16, 2013 3:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 6, Visits: 176
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
Post #1485066
Posted Friday, August 16, 2013 3:52 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 2,294, Visits: 2,754
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’! **
Post #1485067
Posted Friday, August 16, 2013 3:54 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 2,294, Visits: 2,754
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’! **
Post #1485068
Posted Friday, August 16, 2013 4:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 6, Visits: 176
no, it just launches the exe but ignores the input, output ect parameters.
Thanks for your help
Post #1485075
Posted Friday, August 16, 2013 4:27 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 11:42 AM
Points: 2,294, Visits: 2,754
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’! **
Post #1485082
Posted Friday, August 16, 2013 6:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Today @ 3:58 AM
Points: 6, Visits: 176
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
Post #1485145
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse