Home All Groups Group Topic Archive Search About

Delete files in Windows Vista

Author
31 Dec 2006 6:58 PM
BobF
I need to move files between folders. I am using VB.Net 2005. First I check
the target folder to see if the files exist, and if so, delete them. Then I
move the replacements, one at a time using:
If File.Exists(strFileName) then
File.Delete(strFileName)
End If
File.Move(strFileOldName, strNewFileName)

This works just fine in Windows XP. It works in Windows Vista (Release
version) with UAC turned off. With UAC turned on it fails. I don't even get
the UAC prompt.

I was logged on to Vista as a member of the Domain Administrators group when
this occured. Any ideas?

Bob Flenniken

Author
31 Dec 2006 7:33 PM
Stephany Young
Well, you answered your own question haven't you.

It's obvious that it's the UAC, so, if I were you, I'd be researching the
ins and outs of the UAC.


Show quoteHide quote
"BobF" <B***@discussions.microsoft.com> wrote in message
news:E7CB23B8-19AB-4F18-959E-D519D03B88C3@microsoft.com...
>I need to move files between folders. I am using VB.Net 2005. First I check
> the target folder to see if the files exist, and if so, delete them. Then
> I
> move the replacements, one at a time using:
> If File.Exists(strFileName) then
> File.Delete(strFileName)
> End If
> File.Move(strFileOldName, strNewFileName)
>
> This works just fine in Windows XP. It works in Windows Vista (Release
> version) with UAC turned off. With UAC turned on it fails. I don't even
> get
> the UAC prompt.
>
> I was logged on to Vista as a member of the Domain Administrators group
> when
> this occured. Any ideas?
>
> Bob Flenniken
Author
31 Dec 2006 11:29 PM
BobF
Well, that's what I was asking - if anyone know about the UAC and where I
could go to find out. Thankfully, someone else gave me some useful info.

Show quoteHide quote
"Stephany Young" wrote:

> Well, you answered your own question haven't you.
>
> It's obvious that it's the UAC, so, if I were you, I'd be researching the
> ins and outs of the UAC.
>
>
> "BobF" <B***@discussions.microsoft.com> wrote in message
> news:E7CB23B8-19AB-4F18-959E-D519D03B88C3@microsoft.com...
> >I need to move files between folders. I am using VB.Net 2005. First I check
> > the target folder to see if the files exist, and if so, delete them. Then
> > I
> > move the replacements, one at a time using:
> > If File.Exists(strFileName) then
> > File.Delete(strFileName)
> > End If
> > File.Move(strFileOldName, strNewFileName)
> >
> > This works just fine in Windows XP. It works in Windows Vista (Release
> > version) with UAC turned off. With UAC turned on it fails. I don't even
> > get
> > the UAC prompt.
> >
> > I was logged on to Vista as a member of the Domain Administrators group
> > when
> > this occured. Any ideas?
> >
> > Bob Flenniken
>
>
>
Author
31 Dec 2006 8:49 PM
Jay B. Harlow
Bob,
In addition to the other comments, this is a good starting article to learn
about programming with the UAC.

"Least Privilege - Teach Your Apps To Play Nicely With Windows Vista User
Account Control"
http://msdn.microsoft.com/msdnmag/issues/07/01/UAC/

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


Show quoteHide quote
"BobF" <B***@discussions.microsoft.com> wrote in message
news:E7CB23B8-19AB-4F18-959E-D519D03B88C3@microsoft.com...
>I need to move files between folders. I am using VB.Net 2005. First I check
> the target folder to see if the files exist, and if so, delete them. Then
> I
> move the replacements, one at a time using:
> If File.Exists(strFileName) then
> File.Delete(strFileName)
> End If
> File.Move(strFileOldName, strNewFileName)
>
> This works just fine in Windows XP. It works in Windows Vista (Release
> version) with UAC turned off. With UAC turned on it fails. I don't even
> get
> the UAC prompt.
>
> I was logged on to Vista as a member of the Domain Administrators group
> when
> this occured. Any ideas?
>
> Bob Flenniken