CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Posts
    70

    Temp Folder not deleted by Setup

    As I posted earlier, I have been receiving a Path/File Access error right before my application completes its setup on Win 98 machines. I suspect the problem may be caused by the setup program trying to remove the Temporary directory before all the files have been deleted. After the setup there are two files remaining in the Temp directory, ffastlog and Kixtart. The setup code that is supposed to delete the temp files and folder is as follows:
    '-----------------------------------------------------------
    ' SUB: KillTempFolder
    ' BUG FIX #6-34583
    '
    ' Deletes the temporary files stored in the temp folder
    '-----------------------------------------------------------
    '
    Private Sub KillTempFolder()
    Const sWILD As String = "*.*"
    Dim sFile As String

    On Error Resume Next

    sFile = Dir$(gsTEMPDIR & sWILD, vbHidden Or vbReadOnly Or vbSystem)
    Do While Len(sFile) > 0
    SetAttr gsTEMPDIR & sFile, vbNormal
    Kill gsTEMPDIR & sFile
    sFile = Dir$
    Loop
    RmDir gsTEMPDIR
    End Sub

    I couldn't find what the original problem was that BUG FIX #6-34583 corrected.
    Anyone have any idea as to why this code may not be deleting all the folder files.
    Thanks,
    Al





  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Temp Folder not deleted by Setup

    Create/Remove folder

    Make reference to Microsoft Scripting Runtime library

    Dim fso as FileSystemObject

    private Sub Form_Load()
    set fso = new FileSystemObject
    fso.CreateFolder "C:\Test" 'create this folder
    fso.DeleteFile "C:\Test\*.*" 'delete all the files in the folder
    fso.DeleteFolder "C:Test" 'delete the folder



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured