Results 1 to 18 of 18

Thread: [RESOLVED] VB6 app mysterious temp file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2011
    Posts
    194

    Resolved [RESOLVED] VB6 app mysterious temp file

    Someone uses one of my programs said that each time he run it, a file created in temp folder with random name like "~DF383B89D0B766850A.TMP", that program don't access temp folder at all!

    To test I have created an app with no code at all (just empty Form), i noticed that temp file is created too!!!

    What is that file? Can i prevent creating it?
    On Error GoTo Hell

  2. #2
    Hyperactive Member
    Join Date
    Feb 2014
    Posts
    282

    Re: VB6 app mysterious temp file

    A lot of programs when run, will have temp file created. They will be (or should be) automatically deleted when the software is closed.

    For example, Excel create 1 temp file while Windows Photo Viewer create 3. Word create a few including a folder.

    Open a Windows Explorer to show
    "C:\Users\<YourWindowUserName>\AppData\Local\Temp"
    and observe the folder as you open and close programs.

  3. #3
    gibra
    Guest

    Re: VB6 app mysterious temp file

    Quote Originally Posted by Absolute_Zero View Post
    Can i prevent creating it?
    This depend from your code and/or components you use.
    Without this information it's impossible says how to.

    Windows version?

  4. #4
    Hyperactive Member
    Join Date
    Feb 2014
    Posts
    282

    Re: VB6 app mysterious temp file

    Run any VB6 compiled exe even a blank form doing nothing, a temp file will be created. Close it and the temp file is gone. I don't think can do any thing about this.

  5. #5
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: VB6 app mysterious temp file

    Quote Originally Posted by chosk View Post
    Run any VB6 compiled exe even a blank form doing nothing, a temp file will be created. Close it and the temp file is gone. I don't think can do any thing about this.
    That does't sound right. There is no reason to create a temp file, especially when the app does nothing. Granted it's been a while since I've worked with VB6, but I've done a lot of work in the past with it, and never once did the programs I wrote in it produce a temp file of any kind.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    gibra
    Guest

    Re: VB6 app mysterious temp file

    Quote Originally Posted by chosk View Post
    Run any VB6 compiled exe even a blank form doing nothing, a temp file will be created. Close it and the temp file is gone. I don't think can do any thing about this.
    it is not true, absolutely.
    A file (any) is created ONLY when writing code that creates it.

  7. #7
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,904

    Re: VB6 app mysterious temp file

    Or a component, like Crystal Reports

  8. #8
    Hyperactive Member
    Join Date
    Feb 2014
    Posts
    282

    Re: VB6 app mysterious temp file

    Quote Originally Posted by Absolute_Zero View Post
    Someone uses one of my programs said that each time he run it, a file created in temp folder with random name like "~DF383B89D0B766850A.TMP", that program don't access temp folder at all!

    To test I have created an app with no code at all (just empty Form), i noticed that temp file is created too!!!

    What is that file? Can i prevent creating it?
    The tmp file is in this naming format:- ~DF383B89D0B766850A.TMP
    This is the format created by Windows, not by any intentional call by programs to create a temp file (and letting Windows name it) in the temp folder.

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: VB6 app mysterious temp file

    I have never seen this happen.

    I agree that 3rd party libraries might do it, but otherwise you shouldn't be seeing it unless you do it yourself.

    Sounds almost like your VB6.exe or runtime is infected with malware.

  10. #10
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,936

    Re: VB6 app mysterious temp file

    Yeah, I've got to jump into this one too. I've been using VB6 almost daily for a very long time, and I've never seen it create any kind of mysterious "tmp" files that I didn't explicitly create, or at least know why they were created.

    There are only three possible scenarios I could think of where this could even be remotely considered:

    1. If we really want to get highly technical, I suppose we could say that parts of a VB6 program could get shoved into the Windows pagefile. But it wouldn't do anything that looks like what was outlined above.

    2. When in the IDE, we will get a .VBW temp file when we exit a saved .VBP project. This is just a record of the forms and/or modules that were opened when we were last developing this project. And again, this doesn't look anything like what was outlined above.

    3. When using some strange DLL (including OCXs) to which I don't have the source code. None of the core Windows DLLs, nor any of the standard OCX files that come with VB6 create any "tmp" files that I'm aware of (but there possibly are scenarios where you could push them into doing this). However, if you're using a DLL (or OCX) from other sources, it's entirely reasonable that they could creating temp files. In fact, without the source code (or dis-assembly), there's really no way of knowing what they're doing.

    Again, straight-up VB6 isn't going to create any temp files that you haven't explicitly created.

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: VB6 app mysterious temp file

    I should add that many of the IDE designers in VB6 do create temporary files. Quite a few over time.

    Most of these go into the current profile's temporary folder, sometimes they go into the Project folder (current directory of the IDE actually). It depends on the designer.

    I have never seen any go into the old "DOS Temp" folder in the root of the system drive.

  12. #12
    Hyperactive Member
    Join Date
    Feb 2014
    Posts
    282

    Re: VB6 app mysterious temp file

    Windows create a tmp file of that format name for the VB6 IDE without any add-in started at start-up. The attached video shows. This is not a virus or malware.

    The DebugLogFile is used by Windows. The 3 existing tmp files are created by the screen-capture software.
    Attached Files Attached Files

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: VB6 app mysterious temp file

    Who said anything about add-ins? Designers range from the basic Form designer to the DataReport designer and beyond.

    Are you now talking about a design-time issue? You said users were seeing these temp files earlier. If so I'd guess your compiled program has an infection.

  14. #14
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: VB6 app mysterious temp file

    This kind of temp file is created when loading a Form has user's Icon, to confirm
    1- Create new project
    2- Add Form2 and set its Icon property
    3- Add Command1 to Form1
    Code:
    Private Sub Command1_Click()
        Form2.Show
    End Sub
    4- Make Project1.exe
    5- Watch your temp folder
    6- Run Project1.exe
    7- Each time you Show/Hide Form2 a tmp file is created/deleted accordingly.



  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Dec 2011
    Posts
    194

    Re: VB6 app mysterious temp file

    Thanks to all of you

    4x2y had revealed the mystery
    Quote Originally Posted by 4x2y View Post
    This kind of temp file is created when loading a Form has user's Icon, to confirm
    1- Create new project
    2- Add Form2 and set its Icon property
    3- Add Command1 to Form1
    Code:
    Private Sub Command1_Click()
        Form2.Show
    End Sub
    4- Make Project1.exe
    5- Watch your temp folder
    6- Run Project1.exe
    7- Each time you Show/Hide Form2 a tmp file is created/deleted accordingly.
    On Error GoTo Hell

  16. #16
    Hyperactive Member
    Join Date
    Feb 2014
    Posts
    282

    Re: VB6 app mysterious temp file

    Quote Originally Posted by 4x2y View Post
    This kind of temp file is created when loading a Form has user's Icon, to confirm
    1- Create new project
    2- Add Form2 and set its Icon property
    3- Add Command1 to Form1
    Code:
    Private Sub Command1_Click()
        Form2.Show
    End Sub
    4- Make Project1.exe
    5- Watch your temp folder
    6- Run Project1.exe
    7- Each time you Show/Hide Form2 a tmp file is created/deleted accordingly.
    You nail it. A blank form with no code or control but with the icon set in the IDE, when compiled and run, the tmp file is also created by Windows, and then deleted when the exe is closed. This is not a virus, malware or infection!

    I knew this tmp file thing happening but just did not know the reason why and how Windows create and delete them. Now I know. Thank you.

  17. #17
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,579

    Re: VB6 app mysterious temp file

    Quote Originally Posted by chosk View Post
    You nail it. A blank form with no code or control but with the icon set in the IDE, when compiled and run, the tmp file is also created by Windows, and then deleted when the exe is closed.
    It is created by MSVBVM60.DLL or maybe other VB runtimes file and deleted after closing all forms with custom icon, that's why i used two forms to explain that tmp file is created only when loading a Form with custom icon!



  18. #18
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] VB6 app mysterious temp file

    If you set the icon at run time, say from an icon resource, this does not occur.

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