473,320 Members | 1,948 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,320 software developers and data experts.

About deleting file on Vista 64bit

yxq
Hello,
The File.Delete(VS2005) function can not delete file on Vista-64bit, why?

And, what changes of API between 32-bit and 64-bit?

Thank you
Dec 2 '06 #1
6 2122
Hi,

There were a lot of security changes in Vista. Are you sure you
have permission to delete the file?

http://msdn2.microsoft.com/en-us/library/aa480150.aspx

Ken
---------------------
"yxq" <ga***@163.netwrote in message
news:u4**************@TK2MSFTNGP04.phx.gbl...
Hello,
The File.Delete(VS2005) function can not delete file on Vista-64bit, why?

And, what changes of API between 32-bit and 64-bit?

Thank you

Dec 3 '06 #2
yxq
Yes, i have the permission(Right-Click the exe file, choose the Run as
Administrator), even i closed the UAC function.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:72**********************************@micros oft.com...
Hi,

There were a lot of security changes in Vista. Are you sure
you have permission to delete the file?

http://msdn2.microsoft.com/en-us/library/aa480150.aspx

Ken
---------------------
"yxq" <ga***@163.netwrote in message
news:u4**************@TK2MSFTNGP04.phx.gbl...
>Hello,
The File.Delete(VS2005) function can not delete file on Vista-64bit, why?

And, what changes of API between 32-bit and 64-bit?

Thank you


Dec 3 '06 #3
yxq
Sorry, the io.file.delete works well, but the API below for x86 will not
work on x64, how to change the API to x64?

//////////////////////////////////////////////////////////////////////////////////////
Public Class FileOperate
Private Structure SHFILEOPSTRUCT
Dim hWnd As Integer
Dim wFunc As Integer
Dim pFrom As String
Dim pTo As String
Dim fFlags As Short
Dim fAborted As Boolean
Dim hNameMaps As Integer
Dim sProgress As String
End Structure
Private Const FO_DELETE As Short = &H3S
Private Const FOF_ALLOWUNDO As Int16 = &H40S
Private Const FOF_NOCONFIRMATION As Int16 = &H10S
Private Const FO_MOVE As Int16 = &H1S
Private Const FO_COPY As Int16 = &H2S
Private Const FOF_NOERRORUI As Int16 = &H400S
Private Const FOF_SILENT As Int16 = &H4S

Private Declare Function SHFileOperation Lib "shell32.dll" Alias
"SHFileOperationA" (ByRef lpFileOp As SHFILEOPSTRUCT) As Integer
Private Shared SHFileOp As SHFILEOPSTRUCT
Public Shared Function ShellDirectDelete(ByRef sFile As String, Optional
ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function
Public Shared Function ShellDelToRecycled(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION + FOF_NOERRORUI
+ FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellMove(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal MoveEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_MOVE

If MoveEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellCopy(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal CopyEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_COPY

If CopyEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

End Class

"yxq" <ga***@163.netдÈëÏûÏ¢ÐÂÎÅ:Oh**************@TK2MSF TNGP05.phx.gbl...
Yes, i have the permission(Right-Click the exe file, choose the Run as
Administrator), even i closed the UAC function.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:72**********************************@micros oft.com...
>Hi,

There were a lot of security changes in Vista. Are you sure
you have permission to delete the file?

http://msdn2.microsoft.com/en-us/library/aa480150.aspx

Ken
---------------------
"yxq" <ga***@163.netwrote in message
news:u4**************@TK2MSFTNGP04.phx.gbl...
>>Hello,
The File.Delete(VS2005) function can not delete file on Vista-64bit,
why?

And, what changes of API between 32-bit and 64-bit?

Thank you



Dec 3 '06 #4
Hi,

Try using an intptr for the hwnd in the structure. A handle is
not the same size in a 64bit os as a 32bit one.
Private Structure SHFILEOPSTRUCT
Dim hWnd As intptr

Ken
-------------------------
"yxq" <ga***@163.netwrote in message
news:ul**************@TK2MSFTNGP06.phx.gbl...
Sorry, the io.file.delete works well, but the API below for x86 will not
work on x64, how to change the API to x64?

//////////////////////////////////////////////////////////////////////////////////////
Public Class FileOperate
Private Structure SHFILEOPSTRUCT
Dim hWnd As Integer
Dim wFunc As Integer
Dim pFrom As String
Dim pTo As String
Dim fFlags As Short
Dim fAborted As Boolean
Dim hNameMaps As Integer
Dim sProgress As String
End Structure
Private Const FO_DELETE As Short = &H3S
Private Const FOF_ALLOWUNDO As Int16 = &H40S
Private Const FOF_NOCONFIRMATION As Int16 = &H10S
Private Const FO_MOVE As Int16 = &H1S
Private Const FO_COPY As Int16 = &H2S
Private Const FOF_NOERRORUI As Int16 = &H400S
Private Const FOF_SILENT As Int16 = &H4S

Private Declare Function SHFileOperation Lib "shell32.dll" Alias
"SHFileOperationA" (ByRef lpFileOp As SHFILEOPSTRUCT) As Integer
Private Shared SHFileOp As SHFILEOPSTRUCT
Public Shared Function ShellDirectDelete(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function
Public Shared Function ShellDelToRecycled(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION +
FOF_NOERRORUI
Else
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION +
FOF_NOERRORUI + FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellMove(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal MoveEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_MOVE

If MoveEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellCopy(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal CopyEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_COPY

If CopyEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

End Class

"yxq" <ga***@163.net>
дÈëÏûÏ¢ÐÂÎÅ:Oh**************@TK2MSFTNGP05.phx.gbl ...
>Yes, i have the permission(Right-Click the exe file, choose the Run as
Administrator), even i closed the UAC function.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:72**********************************@micro soft.com...
>>Hi,

There were a lot of security changes in Vista. Are you sure
you have permission to delete the file?

http://msdn2.microsoft.com/en-us/library/aa480150.aspx

Ken
---------------------
"yxq" <ga***@163.netwrote in message
news:u4**************@TK2MSFTNGP04.phx.gbl...
Hello,
The File.Delete(VS2005) function can not delete file on Vista-64bit,
why?

And, what changes of API between 32-bit and 64-bit?

Thank you


Dec 3 '06 #5
yxq
Oh, thank you very very much, it works well.

Best Regards
YXQ

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:5E**********************************@micros oft.com...
Hi,

Try using an intptr for the hwnd in the structure. A handle is
not the same size in a 64bit os as a 32bit one.
Private Structure SHFILEOPSTRUCT
Dim hWnd As intptr

Ken
-------------------------
"yxq" <ga***@163.netwrote in message
news:ul**************@TK2MSFTNGP06.phx.gbl...
>Sorry, the io.file.delete works well, but the API below for x86 will not
work on x64, how to change the API to x64?

//////////////////////////////////////////////////////////////////////////////////////
Public Class FileOperate
Private Structure SHFILEOPSTRUCT
Dim hWnd As Integer
Dim wFunc As Integer
Dim pFrom As String
Dim pTo As String
Dim fFlags As Short
Dim fAborted As Boolean
Dim hNameMaps As Integer
Dim sProgress As String
End Structure
Private Const FO_DELETE As Short = &H3S
Private Const FOF_ALLOWUNDO As Int16 = &H40S
Private Const FOF_NOCONFIRMATION As Int16 = &H10S
Private Const FO_MOVE As Int16 = &H1S
Private Const FO_COPY As Int16 = &H2S
Private Const FOF_NOERRORUI As Int16 = &H400S
Private Const FOF_SILENT As Int16 = &H4S

Private Declare Function SHFileOperation Lib "shell32.dll" Alias
"SHFileOperationA" (ByRef lpFileOp As SHFILEOPSTRUCT) As Integer
Private Shared SHFileOp As SHFILEOPSTRUCT
Public Shared Function ShellDirectDelete(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function
Public Shared Function ShellDelToRecycled(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION +
FOF_NOERRORUI
Else
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION +
FOF_NOERRORUI + FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellMove(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal MoveEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_MOVE

If MoveEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellCopy(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal CopyEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_COPY

If CopyEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

End Class

"yxq" <ga***@163.net>
дÈëÏûÏ¢ÐÂÎÅ:Oh**************@TK2MSFTNGP05.phx.gb l...
>>Yes, i have the permission(Right-Click the exe file, choose the Run as
Administrator), even i closed the UAC function.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:72**********************************@micr osoft.com...
Hi,

There were a lot of security changes in Vista. Are you sure
you have permission to delete the file?

http://msdn2.microsoft.com/en-us/library/aa480150.aspx

Ken
---------------------
"yxq" <ga***@163.netwrote in message
news:u4**************@TK2MSFTNGP04.phx.gbl...
Hello,
The File.Delete(VS2005) function can not delete file on Vista-64bit,
why?
>
And, what changes of API between 32-bit and 64-bit?
>
Thank you
>
>


Dec 4 '06 #6
yxq
Could you please view the API below, them will not work on 64bit.
I have change the
Dim hwnd As Integer
to
Dim hwnd As Intptr, but it will not work yet.
Thank you

/////////////////////////////////////////////////////////////////
Private Declare Function ShellExecuteEx Lib "shell32.dll" (ByRef lpExecInfo
As SHELLEXECUTEINFO) As Integer
Private Const SW_NORMAL As Integer = 1
Private Const SW_SHOW As Integer = 5
Private Const SEE_MASK_NOCLOSEPROCESS As Integer = &H40S

Private Structure SHELLEXECUTEINFO
Dim cbSize As Integer
Dim fMask As Integer
Dim hwnd As Integer
Dim lpVerb As String
Dim lpFile As String
Dim lpParameters As String
Dim lpDirectory As String
Dim nShow As Integer
Dim hInstApp As Integer
' fields
Dim lpIDList As Integer
Dim lpClass As String
Dim hkeyClass As Integer
Dim dwHotKey As Integer
Dim hIcon As Integer
Dim hProcess As Integer
End Structure
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
"yxq" <ga***@163.netдÈëÏûÏ¢ÐÂÎÅ:%2****************@TK2M SFTNGP03.phx.gbl...
Oh, thank you very very much, it works well.

Best Regards
YXQ

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:5E**********************************@micros oft.com...
>Hi,

Try using an intptr for the hwnd in the structure. A handle
is not the same size in a 64bit os as a 32bit one.
Private Structure SHFILEOPSTRUCT
Dim hWnd As intptr

Ken
-------------------------
"yxq" <ga***@163.netwrote in message
news:ul**************@TK2MSFTNGP06.phx.gbl...
>>Sorry, the io.file.delete works well, but the API below for x86 will not
work on x64, how to change the API to x64?

//////////////////////////////////////////////////////////////////////////////////////
Public Class FileOperate
Private Structure SHFILEOPSTRUCT
Dim hWnd As Integer
Dim wFunc As Integer
Dim pFrom As String
Dim pTo As String
Dim fFlags As Short
Dim fAborted As Boolean
Dim hNameMaps As Integer
Dim sProgress As String
End Structure
Private Const FO_DELETE As Short = &H3S
Private Const FOF_ALLOWUNDO As Int16 = &H40S
Private Const FOF_NOCONFIRMATION As Int16 = &H10S
Private Const FO_MOVE As Int16 = &H1S
Private Const FO_COPY As Int16 = &H2S
Private Const FOF_NOERRORUI As Int16 = &H400S
Private Const FOF_SILENT As Int16 = &H4S

Private Declare Function SHFileOperation Lib "shell32.dll" Alias
"SHFileOperationA" (ByRef lpFileOp As SHFILEOPSTRUCT) As Integer
Private Shared SHFileOp As SHFILEOPSTRUCT
Public Shared Function ShellDirectDelete(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function
Public Shared Function ShellDelToRecycled(ByRef sFile As String,
Optional ByVal ShowProgress As Boolean = True) As Int16

sFile = sFile & Chr(0)

With SHFileOp
.fAborted = True
.wFunc = FO_DELETE
.pFrom = sFile

If ShowProgress = True Then
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION +
FOF_NOERRORUI
Else
.fFlags = FOF_ALLOWUNDO + FOF_NOCONFIRMATION +
FOF_NOERRORUI + FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellMove(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal MoveEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_MOVE

If MoveEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

Public Shared Function ShellCopy(ByVal SourcePath As String, ByVal
DsintedPath As String, Optional ByVal ShowProgress As Boolean = True, _
Optional ByVal CopyEntireDir As Boolean = True) As Int16

If IO.Directory.Exists(DsintedPath) = False Then
IO.Directory.CreateDirectory(DsintedPath)
Application.DoEvents()

If SourcePath.EndsWith("\") Then
SourcePath.Remove(SourcePath.Length - 1, 1)
If DsintedPath.EndsWith("\") Then
DsintedPath.Remove(DsintedPath.Length - 1, 1)

With SHFileOp
.fAborted = True
.wFunc = FO_COPY

If CopyEntireDir = True Then
.pFrom = SourcePath & Chr(0)
Else
.pFrom = SourcePath & "\*.*"
End If

.pTo = DsintedPath

If ShowProgress = True Then
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI
Else
.fFlags = 0 + FOF_NOCONFIRMATION + FOF_NOERRORUI +
FOF_SILENT
End If

End With
Return SHFileOperation(SHFileOp)
End Function

End Class

"yxq" <ga***@163.netдÈëÏûÏ¢ÐÂÎÅ:Oh**************@TK2MSF TNGP05.phx.gbl...
Yes, i have the permission(Right-Click the exe file, choose the Run as
Administrator), even i closed the UAC function.

"Ken Tucker [MVP]" <vb***@bellsouth.net>
??????:72**********************************@mic rosoft.com...
Hi,
>
There were a lot of security changes in Vista. Are you
sure you have permission to delete the file?
>
http://msdn2.microsoft.com/en-us/library/aa480150.aspx
>
Ken
---------------------
"yxq" <ga***@163.netwrote in message
news:u4**************@TK2MSFTNGP04.phx.gbl.. .
>Hello,
>The File.Delete(VS2005) function can not delete file on Vista-64bit,
>why?
>>
>And, what changes of API between 32-bit and 64-bit?
>>
>Thank you
>>
>>
>




Dec 4 '06 #7

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

Similar topics

9
by: Frank Rizzo | last post by:
I've heard rumblings here and there that various versions of Visual Studio will not run on Vista. I can't find definitive explanation anywhere of which one will run and which one won't. I am...
6
by: Lloyd Sheen | last post by:
I am using VS Express (VB and C#) under Vista Ultimate. When I installed I got msg to install updates to make VS work with Vista. I did this and turned off the msg to show that it is not...
3
by: Rob Latour | last post by:
The following snippet (vb.net 2005) is working just fine in xp but not in vista in xp it lists all related sub keys in the registry just fine. in vista it doesn't list certain ones (like...
7
by: simonroses | last post by:
Hello Guys, I have installed python 2.5 (AMD64) on Vista (64), also installed wx 2.8 but I'm getting this error: """" Traceback (most recent call last): File "mymodule.py", line 39, in...
2
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
have a problem installing visual basic 2008 express edition web install on vista it completed installing the runtime components successfully and then it says ".net framework 3.5 and the other...
7
by: Nicolas Hinze | last post by:
Dear all, I installed Vista SP1 on my Vista x64 Enterprise machine. Now my Visual Basic 2005 (.Net 2) does not behave correctly. It appears that 'for loops' have a problem of some sort. For...
0
by: theS70RM | last post by:
Hey, It seems vista 64 cant display thumbnails for TGA files. Dont really want to use a 3rd party viewer. Found this: http://greggman.com/pages/thumbplug_tga.htm|pagenum=0|lang=english|?q ...
3
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, There is a fatal error while installing VS2008 SP1 on Vista 64bit Business edition. The last line of error log is Installation failed with error code: (0x80070643) I tried to...
2
Nepomuk
by: Nepomuk | last post by:
Recently, I found that I had associated a file type to notepad by mistake. This file type (let's just say, it has the extension .xyz) wasn't supposed to be opened by notepad - actually, it wasn't...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.