|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Q re Dir$Hi
I am testing for the existence of a folder using FolderExists = (Dir$(FolderName, vbDirectory) = ".") I'm finding that prior to executing this command I can go into explorer and rename the folder okay. Once this has been executed, I am informed that it is now in-use so I can't rename it. I wondering what I can do so that I can rename the folder. (I'm using XP SP3) Any suggestions? Thx. Simon Okay so I changed to
FolderExists = (GetAttr(FolderName) = vbDirectory) which seems to work Thx Simon Woods wrote: Show quoteHide quote > Hi > > I am testing for the existence of a folder using > > FolderExists = (Dir$(FolderName, vbDirectory) = ".") > > I'm finding that prior to executing this command I can go into explorer > and rename the folder okay. Once this has been executed, I am informed > that it is now in-use so I can't rename it. > > I wondering what I can do so that I can rename the folder. (I'm using XP > SP3) > > Any suggestions? Thx. > > Simon "Simon Woods" <simonjwo***@hotmail.com> wrote in message Unless other attributes are set on the folder...news:%23cvvIZ1mJHA.3876@TK2MSFTNGP02.phx.gbl... > Okay so I changed to > > FolderExists = (GetAttr(FolderName) = vbDirectory) > > which seems to work CBool(GetAttr(foldername) And vbDirectory) which can still give a false return if access is denied but is often good enough > Simon Woods wrote: "." is not always returned so that's never a good way to test>> Hi >> >> I am testing for the existence of a folder using >> >> FolderExists = (Dir$(FolderName, vbDirectory) = ".") >> I'm finding that prior to executing this command I can go into explorer Dir$ opens the folder so you need to close it by opening another folder; >> and rename the folder okay. Once this has been executed, I am informed >> that it is now in-use so I can't rename it. >> >> I wondering what I can do so that I can rename the folder. (I'm using XP >> SP3) >> >> Any suggestions? Thx. IIRC using dir$("nul") works but it's been a while and I'm not in a position to test it right now.
Please help to translate this short Delphi code
close excel from VB6 Pset and SetPixel Bug How to get special Appdata folder How difficult is to add my menu to Windows Explorer? Use Proc with Static Variables Multiple Times OT MS Community Visibility Vista behaves differently to WordBasic command even though same version of Word! Unbelieveable code, it produces one result in VB6 run and another if compiled in a exe file ???? Wha Legacy vs Opp |
|||||||||||||||||||||||