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

G

Guest

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
 
G

Guest

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 ..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top