473,378 Members | 1,209 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

xcopy using System.Diagnostics.Process doesnt work on W2k with SP4

Hi.

Following code works fine on XP, but not on W2K+SP4. When I run it on W2K,
it does not give me any error, exception. I have tried setting
StartInfo.ErrorDialog = True, ErrorDialogParentHandle, CreateNoWindow =
False, but in vain...

The xcopy is available in the path set in system environment variable of W2k
box...

Dim objProcess As New Process
Try
Me.Cursor = Cursors.WaitCursor
objProcess.StartInfo.FileName = "xcopy.exe"
objProcess.StartInfo.Arguments = QUOTE & TEMPLATEFOLDER &
QUOTE & " " & QUOTE & m_strQuotePath & QUOTE & " /e /c /q /g /h /r /y /i"
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
objProcess.StartInfo.CreateNoWindow = False
objProcess.StartInfo.ErrorDialog = True
objProcess.StartInfo.ErrorDialogParentHandle = Me.Handle
objProcess.Start()
objProcess.WaitForExit()
blnPhysicalFolderCreated = True
'2. Create an entry in the database for the new quote
objBO.CreateQuote(m_strQuote, Environment.UserName,
txtJob.Text.Trim)
Catch ex As Exception
If (blnPhysicalFolderCreated) Then 'Exception occured,
remove the folder from network drive
Directory.Delete(m_strQuotePath, True)
End If
MsgBox("exception:" & ex.StackTrace)
Throw ex
Finally
objProcess.Close()
Me.Cursor = Cursors.Default
End Try

Any ideas are greatly appreciated.

TIA
Sriram.
rsriram22 at hotmail
Nov 3 '05 #1
1 2459
I think I found out the problem - It was with "/g" option. This is not
supported in W2K's XCopy.

Yet, I think an error saying the same could have been shown ..

"Sriram" wrote:
Hi.

Following code works fine on XP, but not on W2K+SP4. When I run it on W2K,
it does not give me any error, exception. I have tried setting
StartInfo.ErrorDialog = True, ErrorDialogParentHandle, CreateNoWindow =
False, but in vain...

The xcopy is available in the path set in system environment variable of W2k
box...

Dim objProcess As New Process
Try
Me.Cursor = Cursors.WaitCursor
objProcess.StartInfo.FileName = "xcopy.exe"
objProcess.StartInfo.Arguments = QUOTE & TEMPLATEFOLDER &
QUOTE & " " & QUOTE & m_strQuotePath & QUOTE & " /e /c /q /g /h /r /y /i"
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
objProcess.StartInfo.CreateNoWindow = False
objProcess.StartInfo.ErrorDialog = True
objProcess.StartInfo.ErrorDialogParentHandle = Me.Handle
objProcess.Start()
objProcess.WaitForExit()
blnPhysicalFolderCreated = True
'2. Create an entry in the database for the new quote
objBO.CreateQuote(m_strQuote, Environment.UserName,
txtJob.Text.Trim)
Catch ex As Exception
If (blnPhysicalFolderCreated) Then 'Exception occured,
remove the folder from network drive
Directory.Delete(m_strQuotePath, True)
End If
MsgBox("exception:" & ex.StackTrace)
Throw ex
Finally
objProcess.Close()
Me.Cursor = Cursors.Default
End Try

Any ideas are greatly appreciated.

TIA
Sriram.
rsriram22 at hotmail

Nov 3 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: grutta | last post by:
I am writing a windows service that will recieve notification when a USB Device is insterted into the machine. I have used the RegisterDeviceNotification and the RegisterServiceCtrlHandlerEx with...
2
by: Brian Link | last post by:
Is there a Platform way to grab an entire directory and copy it? Or will I have to iterate through the files and binary write them? Thanks BLink Brian Link in St. Paul ----------------------...
3
by: vbMark | last post by:
Here is my C# code in the ASP.NET page. public static void DoConvert ( string sFile ) { string cmd = "foo.exe" ; string param = " /bar.txt" ; Process myproc ; // <-- Error here...
2
by: Matthew Lee | last post by:
I am using a C# / ASP.NET application to fire an XCOPY job from the webserver to a UNC share. This setup works fine when copying to a local machine but refuses to work on the remote copy. The...
2
by: Grigs | last post by:
Hello, I am attempting to write a Web Method in my Web Service that starts a process that runs the XCOPY command with passed in parameters. It is failing on me through code. However, if I take...
5
by: Volker Jobst | last post by:
Hi. I have this code: Dim p As New Process Dim info As New ProcessStartInfo Dim sa As New ArrayList Dim s As String Try With info
1
by: Sriram | last post by:
Hi. Following code works fine on XP, but not on W2K+SP4. When I run it on W2K, it does not give me any error, exception. I have tried setting StartInfo.ErrorDialog = True,...
13
by: Chris Johnson | last post by:
I have what seems to be such a simple thing yet I cannot figure out how to do it. I am using a streamwriter to build a text file. At the end of the process I want to open that same text file in...
5
by: Bremanand | last post by:
Hi my asp.net web application having one button which has the following code in its click event to open an .exe.... System.Diagnostics.Process pro = new System.Diagnostics.Process();...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.