Solved

C# and Batch files

Posted on 2014-04-04
12
344 Views
Last Modified: 2014-05-08
hi

can any one suggest me , how can i use parallel programming , to execute a batch file, as the batch file is taking a lot of time to run , and i want to reduce that

1. a batch file  programme loads a file into database .
2. this takes 4 hours right now , which is too much .
3. I want to use parellel programming to , reduce the total time taken by this.
4. can you please help me to suggest that .
5. i am open for other way of doing this. which reduces the time taken to 20 -30 mins at least .



6. i can not use SSIS to load the file as the batch file is written by different vendor , and is not possible to change.
0
Comment
Question by:BeyondBGCM
  • 5
  • 4
12 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 39977429
if the batch file is written by a vendor, you cannot do a lot ...
unless the batch file has options to call with several parameters, so they could be called "in parallel"...
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 250 total points
ID: 39977443
Very difficult to provide sound advice here. You are basically telling us "I want to change the batch file, but I cannot change it". As Guy told, if the vendor does not allow for splitting up the tasks or data into several junks and control that from outside, there is no way to do that.
Depending on what the batch does, it might be impossible to reduce the time needed - if there is nothing you can execute in parallel, you can't, e.g. because there are many steps and they all are build on each other, so need to run strictly in sequence.
0
 

Author Comment

by:BeyondBGCM
ID: 40011591
that's true , that  i can not change the batch file , but as you know calling batch file in c# using System.Diagnostic.Process , can i use Parallel programming to call the batch file


this is like , right now i am calling Batch file with Process class of Systm.Diagnostic, but it is taking a lot of time to run (4 hours)

now , can i use parallel programming , or other mode , to distribute the load of the execution to multiple processor.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 40011730
No, you can't. Taking four cars to dtive a certain distance will take the same time as with one car, unless you are able to let them drive into different directions.
0
 

Author Comment

by:BeyondBGCM
ID: 40022304
that's fine , thanks :)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:BeyondBGCM
ID: 40022333
I've requested that this question be closed as follows:

Accepted answer: 0 points for BeyondBGCM's comment #a40022304

for the following reason:

i accept , that there is no solution to this question.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 40022334
0
 

Author Comment

by:BeyondBGCM
ID: 40025602
i don't want to go in details of this , as if you can read the book Parallel programming with C# ,by Wrox, they clearly say  , it is possible , but if you say it is not possible , i accept it , i have no time , to get in to the discussion for this. you can close it which ever you want
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 40025605
Your misconception is that you have the means to start parallel processing in C# (or C++ or ...), but no influence on the internals of external utilities you start in parallel. You always need to adapt the job to only do a part of the overall task if you want to split execution.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 40050956
Closing recommendation: Split
  http:#a39977429
  http:#a39977443
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 77
VB6 Compile Compatibility Issue 4 87
Eclipse Neon start with Admin account only 6 91
listing all functions in JavaScript 19 173
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now