Extracting strings from binary data
Hello,
I am trying to extract string from a binary file.
At the unix command line (sunos) I can just type;
strings <filename>
This is a nice way to get a list of the contents of a directory.
Is there a way in pl/sql to extract strings from binary data ? An equiv to strings on unix/linux ?
Thanks in advance.
Ben
Hi,
If you do want to list the contents of a directory, there are other ways to do it. Here's a base implementation of a utility I wrote:
create or replace and resolve java source named "Util" as
import java.io.*;
import java.sql.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
public class Util {
public static void listFiles(String directory, oracle.sql.ARRAY[] names)
throws IOException, SQLException {
File f = new File(directory);
if(f==null)
throw new IOException("Directory: "+directory+" does not exist.");
String[] files = f.list(
new FilenameFilter() {
public boolean accept(File dir, String name) {
// List all files
return true;
Connection conn = new OracleDriver().defaultConnection();
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("VC_TAB_TYPE", conn);
names[0] = new ARRAY(descriptor, conn, files);
return;
create or replace type vc_tab_type is table of varchar2(255);
create or replace package util authid current_user as
function list_files(p_directory in varchar2)
return vc_tab_type;
end;
create or replace package body util as
procedure list_files (
p_directory in varchar2
, p_filenames out nocopy vc_tab_type
is
language java
name 'Util.listFiles(java.lang.String, oracle.sql.ARRAY[])';
function list_files(p_directory in varchar2) return vc_tab_type
is
l_filenames vc_tab_type := vc_tab_type();
begin
list_files(p_directory, l_filenames);
return l_filenames;
end;
end;
/You can then query the filesystem as follows:
1 select column_value as filename
2 from table(util.list_files('c:\windows'))
3 where column_value like '%.log'
4* and rownum <= 10
SQL> /
FILENAME
0.log
AdfsOcm.log
aspnetocm.log
bkupinst.log
certocm.log
chipset.log
cmsetacl.log
comsetup.log
DtcInstall.log
FaxSetup.log
10 rows selected.cheers,
Anthony
Similar Messages
-
Extracting string from CLOB data
All, I have a table that has two columns, ID and CLOB_DATA. For the CLOB_DATA, the data is simply a long string of text with pipes at certain intervals as follows:
CLOB_DATA
1423292Myname is so and so etc wyouhsma||QA29-9878|3/7/89|6798.78|||ETCCCC.......||
The above would be one record in the table. As an example, I need to extract the string QA29-9878 from this data. All I know is that this particular string will always be between the second and third pipe. I realize this maybe require just a simple query using the substr and instr functions but I can quite construct it so any help would be appreciated.
Thanks.SQL> WITH t AS
2 (SELECT '1423292Myname is so and so etc wyouhsma||QA29-9878|3/7/89|6798.78|||' str
3 FROM dual)
4 SELECT ltrim(regexp_substr(str,'(^|\|)[^|]*',1,3),'|') sub_str FROM t
5 /
SUB_STR
QA29-9878 -
I am facing a strange SQL exception:-
The code flow is like this:
.Net 4.0 --> Entity Framework --> SQL 2008 ( StoredProc --> Function {Exception})
In the SQL Table-Valued Function, I am selecting a column (nvarchar(50)) from an existing table and (after some filtration using inner joins and where clauses) inserting the values in a Table Type Object having a column (nvarchar(50))
This flow was working fine in SQL 2008 but now all of sudden the Insert into @TableType is throwing "string or binary data would be truncated" exception.
Insert Into @ObjTableType
Select * From dbo.Table
The max length of data in the source column is 24 but even then the insert statement into nvarchar temp column is failing.
Moreover, the same issue started coming up few weeks back and I was unable to find the root cause, but back then it started working properly after few hours
(issue reported at 10 AM EST and was automatically resolved post 8 PM EST). No refresh activity was performed on the database.
This time however the issue is still coming up (even after 2 days) but is not coming up in every scenario. The data set, for which the error is thrown, is valid and every value in the function is fetched from existing tables.
Due to its sporadic nature, I am unable to recreate it now :( , but still unable to determine why it started coming up or how can i prevent such things to happen again.
It is difficult to even explain the weirdness of this bug but any help or guidance in finding the root cause will be very helpful.
I also Tried by using nvarchar(max) in the table type object but it didn't work.
Here is a code similar to the function which I am using:
BEGIN
TRAN
DECLARE @PID
int = 483
DECLARE @retExcludables
TABLE
PID
int NOT
NULL,
ENumber
nvarchar(50)
NOT NULL,
CNumber
nvarchar(50)
NOT NULL,
AId
uniqueidentifier NOT
NULL
declare @PSCount int;
select @PSCount =
count('x')
from tblProjSur ps
where ps.PID
= @PID;
if (@PSCount = 0)
begin
return;
end;
declare @ExcludableTempValue table (
PID
int,
ENumber
nvarchar(max),
CNumber
nvarchar(max),
AId
uniqueidentifier,
SIds
int,
SCSymb
nvarchar(10),
SurCSymb
nvarchar(10)
with SurCSymbs as (
select ps.PID,
ps.SIds,
csl.CSymb
from tblProjSur ps
right
outer join tblProjSurCSymb pscs
on pscs.tblProjSurId
= ps.tblProjSurId
inner join CSymbLookup csl
on csl.CSymbId
= pscs.CSymbId
where ps.PID
= @PID
AssignedValues
as (
select psr.PID,
psr.ENumber,
psr.CNumber,
psmd.MetaDataValue
as ClaimSymbol,
psau.UserId
as AId,
psus.SIds
from PSRow psr
inner join PSMetadata psmd
on psmd.PSRowId
= psr.SampleRowId
inner join MetaDataLookup mdl
on mdl.MetaDataId
= psmd.MetaDataId
inner join PSAUser psau
on psau.PSRowId
= psr.SampleRowId
inner
join PSUserSur psus
on psus.SampleAssignedUserId
= psau.ProjectSampleUserId
where psr.PID
= @PID
and mdl.MetaDataCommonName
= 'CorrectValue'
and psus.SIds
in (select
distinct SIds from SurCSymbs)
FullDetails
as (
select asurv.PID,
Convert(NVarchar(50),asurv.ENumber)
as ENumber,
Convert(NVarchar(50),asurv.CNumber)
as CNumber,
asurv.AId,
asurv.SIds,
asurv.CSymb
as SCSymb,
scs.CSymb
as SurCSymb
from AssignedValues asurv
left outer
join SurCSymbs scs
on scs.PID
= asurv.PID
and scs.SIds
= asurv.SIds
and scs.CSymb
= asurv.CSymb
--Error is thrown at this statement
insert into @ExcludableTempValue
select *
from FullDetails;
with SurHavingSym as (
select distinct est.PID,
est.ENumber,
est.CNumber,
est.AId
from @ExcludableTempValue est
where est.SurCSymb
is not
null
delete @ExcludableTempValue
from @ExcludableTempValue est
inner join SurHavingSym shs
on shs.PID
= est.PID
and shs.ENumber
= est.ENumber
and shs.CNumber
= est.CNumber
and shs.AId
= est.AId;
insert @retExcludables(PID, ENumber, CNumber, AId)
select distinct est.PID,
Convert(nvarchar(50),est.ENumber)
ENumber,
Convert(nvarchar(50),est.CNumber)
CNumber,
est.AId
from @ExcludableTempValue est
RETURN
ROLLBACK
TRAN
I have tried by converting the columns and also validated the input data set for any white spaces or special characters.
For the same input data, it was working fine till yesterday but suddenly it started throwing the exception.Remember, the CTE isn't executing the SQL exactly in the order you read it as a human (don't get too picky about that statement, it's at least partly true enough to say it's partly true), nor are the line numbers or error messages easy to read: a mismatch
in any of the joins along the way leading up to your insert could be the cause too. I would suggest posting the table definition/DDL for:
- PSMetadata, in particular PSRowID, but just post it all
- tblProjectSur, in particularcolumns CSymbID and TblProjSurSurID
- cSymbLookup, in particular column CSymbID
- PSRow, in particular columns SampleRowID, PID,
- PSAuser and PSUserSur, in particualr all the USERID and RowID columns
- SurCSymbs, in particular colum SIDs
Also, a diagnostic query along these lines, repeat for each of your tables, each of the columns used in joins leading up to your insert:
Select count(asurv.sid) as count all
, count(case when asurv.sid between 0 and 9999999999 then 1 else null end) as ctIsaNumber
from SurvCsymb
The sporadic nature would imply that the optimizer usually chooses one path to the data, but sometimes others, and the fact that it occurs during the insert could be irrelevant, any of the preceding joins could be the cause, not the data targeted to be inserted. -
Extracting Year from the date field
Hi,
I want to extract year from the date field... I've tried following code but got the error
SELECT to_char(a.A_EXPIRY_DATE,'yyyy') as EXP_YEAR from Table_A a
Please advice
Thanks in advanceuser12863454 wrote:
SELECT to_char(a.A_EXPIRY_DATE,'yyyy') as EXP_YEAR from Table_A aThis should work and returns a string.
What error did you get?
maybe your column name is wrong? Is it really A_somthing? This is possible but slightly unusual.
also possible
select extract(Year from sysdate) from dual;
/* with your table and column */
SELECT extract(year from a.A_EXPIRY_DATE) as EXP_YEAR from Table_A a;Edited by: Sven W. on Aug 18, 2010 6:41 PM -
String or binary data would be truncated - different service packs on publisher vs distributor
We have transactional replication where the publisher is 10.0.4067 and the distributor is 10.0.4000. The distribution agent will periodically will fail with the following error: String
or binary data would be truncated
SQLSTATE 22001] (Error 8152). The tables on the publisher and subscriber are all the same data type. Could the version difference be causing this issue? Do we need
to upgrade the distributor sql server (different server than the publication server)?Hello,
Just as others post above, the difference service pack version between publisher and distributor should not cause this issue.The replication workfolw between publisher and distributor is through the Log Reader Agent which
runs at the Distributor, it reads the publication transaction log in publisher and copies those transactions in batches to the distribution database at the Distributor.
You can refer to the following thread which about the similar issue casused by a long stored procedure:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5bbf2c8c-a5c0-4a22-b30b-82b6ce4f1fea/an-error-prevents-replication-from-synchronizing-string-or-binary-data-would-be-truncated?forum=sqlreplication.
Regards,
Fanny Liu
If you have any feedback on our support, please click here.
Fanny Liu
TechNet Community Support -
Synch Error: String or binary data would be truncated.
I kicked off an inital synch for WebTools 2007 (may also be an issue in 596) and I had 1 synch error for SBOPartner:
String or binary data would be truncated.
The statement has been terminated.
at netpoint.api.data.DataFunctions.Execute(String SQL, IDataParameter[] parameters, String connectionstring)
at netpoint.api.NPBase.MarkSynched(String SynchID)
at NetPoint.SynchSBO.SBOObjects.SBOPartner.SBOToNetPoint(SBOQueueObject qData)
at NetPoint.SynchSBO.SynchObjectBase.Synch()
I traced the sql log and found the problem was related to addresses. The synchid only allows 50 characters but my synchid was 51 characters (COMINF, Communication Infrastructure Corporation, S). Anyway, to fix I modified the table to allow 100 characters and reran the synch. I know an upgrade will set it back to 50 but at least it's working now.
I tried to post this to support as a bug but I couldn't figure out how (as usual) or the authorization stuff changed so I figured I would post it here so hopefully the devs will see this and update the code.
SteveThanks Shawn ... My version of Netpoint is 2007.0.620.0 and the synch manager is 2007.0.620.35247. I'm not sure what patch level this means I am on though.
Steve -
"String or binary data would be truncated" and field specifications
Hi all,
i have "String or binary data would be truncated" error when i try to execute an insert statment.
can i find witch field is affected by this error? (for return it to the user)
thank's allAs far as I am aware, there's no way to determine which column's length has been exceeded.
You should add code into your stored procedure to check the lengths of variables before inserting their values into your tables, raising an error if necessary - see the example below.
Again I stress that it would be better to modify the client application's code to either warn the user or to limit the number of characters they can enter into a field.
Chris
Code Snippet
--This batch will fail with the SQL Server error message
DECLARE @MyTable TABLE (MyID INT IDENTITY(1, 1), MyValue VARCHAR(10))
DECLARE @MyParameter VARCHAR(100)
--Create a string of 52 chars in length
SET @MyParameter = REPLICATE('Z', 52)
INSERT INTO @MyTable(MyValue)
VALUES (@MyParameter)
GO
--This batch will fail with a custom error message
DECLARE @MyTable TABLE (MyID INT IDENTITY(1, 1), MyValue VARCHAR(10))
DECLARE @MyParameter VARCHAR(100)
--Create a string of 52 chars in length
SET @MyParameter = REPLICATE('Z', 52)
IF LEN(@MyParameter) > 10
BEGIN
RAISERROR('You attempted to insert too many characters into MyTable.MyValue.', 16, 1)
RETURN
END
ELSE
BEGIN
INSERT INTO @MyTable(MyValue)
VALUES (@MyParameter)
END
GO -
String or binary Data would be truncated. Error detected by database DLL
Having problems generating two reports in Crystal Reports v8.5. I can run it on my machine and one on one of my Terminal Server(TermA). However when I tried to generate the same two reports on my second terminal server(TermB), it crashed and I get the following error messages: ODBC error: String or binary data would be truncated and Error detected by database DLL We have one set user ID and password to generate all of our Crystal Reports.
Steps taken:
Reinstall Crystal on TermB server and did a fresh installation of Crystal 8.5 on another workstation. Ran the reports and the result were the same (unable to generate the report) same errors messages.
Please HELP...
Thanks.Terminal Server was not supported in CR 8.5
-
Hi,
can any anyone give me a solution for this.It is pretty old /famous error
http://dimantdatabasesolutions.blogspot.co.il/2008/08/string-or-binary-data-would-be.html
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Displaying image from binary data using java
hi there,
i have created a swing applet displays me a url, what the url returns me is the image in binary format, and i want to show the complete image using that binary data
so how do i do it.
some thing like this :
URL url = new URL("http://192.168.1.1:8086/file-storage/download/Zerg.jpg?version_id=35688");
JEditorPane jep = new JEditorPane();
jep.setPage(url);
output is in binary on my applet window.Hey,
This displays an image from a url, you could check if your url is and image or not using URL.getFileName() and see if it ends in gif jpeg etc. and then display it this way.
hope it helps
Nick Hanlon
import java.awt.*;
import java.awt.Image.*;
import java.awt.Toolkit.*;
import javax.swing.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import javax.swing.text.html.*;
public class SimpleApp extends JFrame {
public static void main(String args[]) {
SimpleApp aFrame = new SimpleApp();
public SimpleApp() {
super("Frame");
/*JEditorPane jep = new JEditorPane();
jep.*/
try {
HTMLEditorKit htmlKit = new HTMLEditorKit();
JEditorPane ep = new JEditorPane();
try {
ep.setEditorKit(htmlKit);
BufferedReader in = new BufferedReader(
new StringReader(
"<HTML><IMG SRC=\"http://developer.java.sun.com/images/chiclet.row.gif\"></HTML>"));
htmlKit.read(in, ep.getDocument(),0);
getContentPane().setLayout(new BorderLayout());
setResizable(false);
getContentPane().add(ep, "North");
pack();
show();
} catch (javax.swing.text.BadLocationException e) {}
} catch (IOException e) {}
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { System.exit(0); }
} -
Tools for extracting strings from java code for internationalization
For legacy code with lots and lots of strings what method is typically used to extract strings for internationalization?
Am I right in thinking you couldnt simply grep for strings, it could get pretty complitcated, especially with escape characters, escaped quotes etc.,
-SKWhen dealing with legacy code, it is nice to have an application that queries you as it extracts the strings. You have a choice whether to accept the string as a localizable entity or not.
There are several tools that do this...including some IDEs like JBuilder. Although it isn't a fully supported or robust tool, Sun has a utility for extracting strings in Java source files:
http://java.sun.com/products/jilkit/.
Regards,
John O'Conner -
String or binary data would be truncated.
Anyone know why I would get this error when trying to place binary data into a sql server 2000 db? The file's length is 5512, and the length of the field I'm putting it in is 8000.
ThanksThat returns the length in bytes. Is the database field defined in bytes or bits?
-
Hi All,
I am reading notepads files and inserting data in sql tables from the notepad-
while performing sql bulk copy on this line it throws exception - "bulkcopy.WriteToServer(dt); -"data type related(mentioned in subject )".
Please go through my logic and tell me what to change to avoid this error -
public void Main()
Dts.TaskResult = (int)ScriptResults.Success;
string[] filePaths = Directory.GetFiles(@"C:\Users\jainruc\Desktop\Sudhanshu\master_db\Archive\test\content_insert\");
for (int k = 0; k < filePaths.Length; k++)
string[] lines = System.IO.File.ReadAllLines(filePaths[k]);
//table name needs to extract after = sign
string[] pathArr = filePaths[0].Split('\\');
string tablename = pathArr[9].Split('.')[0];
DataTable dt = new DataTable(tablename);
|
string[] arrColumns = lines[1].Split(new char[] { '|' });
foreach (string col in arrColumns)
dt.Columns.Add(col);
for (int i = 2; i < lines.Length; i++)
string[] columnsvals = lines[i].Split(new char[] { '|' });
DataRow dr = dt.NewRow();
for (int j = 0; j < columnsvals.Length; j++)
//Console.Write(columnsvals[j]);
if (string.IsNullOrEmpty(columnsvals[j]))
dr[j] = DBNull.Value;
else
dr[j] = columnsvals[j];
dt.Rows.Add(dr);
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=UI3DATS009X;" + "Initial Catalog=BHI_CSP_DB;" + "User Id=sa;" + "Password=3pp$erv1ce$4";
conn.Open();
SqlBulkCopy bulkcopy = new SqlBulkCopy(conn);
bulkcopy.DestinationTableName = dt.TableName;
bulkcopy.WriteToServer(dt);
conn.Close();
Issue 1:-
I am reading notepad: getting all column and values in my data table now while inserting for date and time or integer field i need to do explicit conversion how to write for specific column before bulkcopy.WriteToServer(dt);
Issue 2:- Notepad does not contains all columns nor in specific sequence in that case i can add few column ehich i am doing now but the issue is now data table will add my columns + notepad columns and while inserting how to assign in perticular colums?
sudhanshu sharma Do good and cast it into river :)Hi,
I think you'll have to do an explicit column mapping if they are not in exact sequence in both source and destination.
Have a look at this link:
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopycolumnmapping(v=vs.110).aspx
Good Luck!
Kaur.
Please mark as answer if this resolves your issue. -
Extracting string from a file name
Hello,
I have a legacy (read: I didn't build it) SharePoint list that includes some validation when uploading files that's giving me some trouble.
Basically, our users are required to add files to a list in a certain filename format and based on the naming convention are approved/rejected and routed to the appropriate location.
One of the validations looks at a section of the file name and compares it to a folder name in the library.
For example, the file name format is XX_AAA_999_2014_05.xlsx and that matches on the folder name of /submissions/2014_05
Currently the rule says look at the last 7 characters of the folder and the 7 characters starting at position 12 of the filename and make sure they match.
The problem is the 999 in the example above is a sequential identifier to the project a file is associated with... e.g. they range from project 000 to project 999. We've now hit project 1000 so file being added for project 1000 (and beyond) fails because
the starting position has shifted one spot. (Note: we have active 3 digit projects so I cannot simply change that to be position 13... not to mention what that does to my history).
So, my task is to come up with something that can accomodate 3 or 4 digit numbers.
I'm trying to stick as closely to the original setup so I don't mess up the history so I'm looking at other methods of getting to the same data in the string. Another problem is that the file names include the extension and the extension can be 3 (pdf)
or 4 (xlsx) characters long.
I've tried this: =LEFT([Source File Name],SEARCH(".",[Source File Name])-1)
but that brings back everything in front of the period and I need just the 7 preceeding characters. Is there a way to limit the number of chars a LEFT() function returns?
In a nutshell, the 4 variations of file names are as follows of which I need to extract the
bolded section.:
ZZ_AAA_999_2014_05.xls
ZZ_AAA_999_2014_05.xlsx
ZZ_AAA_1000_2014_05.xls
ZZ_AAA_1000_2014_05.xlsx
Thanks!
KevinHi,
According to your description, you might want to retrieve the string “2014_05” from the file name.
I would suggest you create a SharePoint Designer workflow and implement your logic of handling the filename.
In SharePoint Designer 2010, there are already some useful utility workflow actions which can enable users to deal with the various requirements come from the business scenarios.
For the string handling, you can consider to use the
Utility Actions:
http://msdn.microsoft.com/en-us/library/office/jj164026(v=office.15).aspx
Another two links about creating SharePoint Designer workflow for your reference:
http://office.microsoft.com/en-001/sharepoint-designer-help/introduction-to-designing-and-customizing-workflows-HA101859249.aspx
http://www.codeproject.com/Tips/415107/Create-a-Workflow-using-SharePoint-Designer
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Patrick Liang
TechNet Community Support -
Extracting text from BLOB data
Let me start by saying that I'm flying by the seat of my pants on this and I'm neither a CR expert nor can I write SQL. Short of a little basic back on my old Apple IIe (way back when,) my programming skills are essentially nil.
That said, here's what I'm trying to acheive.
I have created a report that uses an ODBC connection to an Oracle database. It works fine, all the tables are properly linked and it delivers a properly functioning report. I now need to extract some text from a BLOB field. I have all the necessary tables added to the report and I've linked them as well. However, when I add an SQL expression and paste in the SQL string that uses the function, "getprop" to try to extract the necessary text from the BLOB data, I get the error: "missing expression"
I notice that within the SQL Expression editor, the field for the BLOB data is not listed in the table in which it resides, though the non-BLOB fields are listed. That is, when I say: select getprop(sl.blobdata,'confirmCompany'), there is no sl.blobdata field which I believe is the source of the "missing expression" error.
If I create a new blank report and simply paste the SQL in as a command in the Database Expert, it will deliver the expected results. I get the two fields I need. This means the SQL string is fine. But, of course, all the other columns I need are not available. As I mentioned above, I can't write SQL and I have a fully functional report that has everything except the two columns i want to add from the BLOB field.
However if I go back to my complete report and add the SQL as a command in the Database Expert, it then asks me to link the fields to the other tables already in the report and that just doesn't work.
I apologize for any mucked up terminology and general concept confusing statements I've made above and hope someone will be able to help me out.
Thanks in advance.
~mSo, in this case you might create a subreport that has
"the SQL in as a command in the Database Expert, it will deliver the expected results. I get the two fields I need. This means the SQL string is fine. But, of course, all the other columns I need are not available. As I mentioned above, I can't write SQL and I have a fully functional report that has everything except the two columns i want to add from the BLOB field. "
of course, this will return all the results, every time it gets kicked off, this is why having something to link to is handy.
You can filter the subreport data, based on main report parameters, if that will help.
Maybe you are looking for
-
When I search my hard drive to find space for freeing up memory I have a lot of files for Apps, and music. I am wondering if these are pertinant and need to be kept on my hard drive, or if I can remove them in any way. Any help would be appreciated.
-
PLease help me in wrirting this query
Hi all, i want to write a query using standard emp table.But output required is like deptno ename 10 smith alen mark 20 ram hanuman Thus if deptno is same for some employees it should be printed once only Any help is highly appreciated
-
Excel and CASE statement.
Hello Experts, I am using a CASE statement on CHAR column as follows: CASE WHEN Sales.Ret='Y' THEN 'Returning' ELSE 'New' END It gives an error: Odbc driver returned an error (SQLExecDirectW). Whereas when I use another CASE statement with Numrical c
-
I'm running FCP6 on a macbook pro. I've moved a project from my MacPro system (running FCP6) so that I can work on it while I'm on the road. I moved the "project title" media folder from the capture scratch into a new capture scratch folder on the dr
-
How to run batch files in the backround ??????
please anyone tell me how to run the batch files in the background i dont want anyone to interfere the batch file..The batch file has to run for a long time even days so it will be safe if the batch file is running in the bachgroung somewhere .. plea