VB6 Can I have the app save to my application dir automatic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wernerh
    New Member
    • Jul 2007
    • 104

    VB6 Can I have the app save to my application dir automatic

    Hi,

    I have written my application and given the text files a dir to save to. Is there a way that that dir would read as a wildcard wherever I install it to? Example I have the drive path listed as c:\......... , I want to install to the d drive without having to change the application path in the code.

    Here is my code:
    Dim r1 As String
    Dim fileName As String
    fileName = "C:\miprice software\data\r 1.txt"
    r1 = FreeFile
    Open fileName For Output As #r1
    Print #r1, Text1.Text
    Close #r1



    I want the "filename = "c"............ ... to be a wildcard....
    Just the \Miprice software\Data\r 1.txt stays static.

    Hope this makes sense.

    Thanks
    Werner
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Two things come to mind.

    First, App.Path will give you the path that the program was installed to, which may be enough.

    Secondly, you can have the installation procedure create entries for you in the registry to identify the save path. Not sure about the supplied Package and Deployment wizard, but if you get a decent installation creator such as InstallShield, I'm sure they can do that.

    Comment

    • Wernerh
      New Member
      • Jul 2007
      • 104

      #3
      Hi,

      Thanks, I went the app.path route and it works perfectly.

      Thanks again
      Werner

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by Wernerh
        Thanks, I went the app.path route and it works perfectly.
        Great! Glad we could help. :)

        Comment

        • Wernerh
          New Member
          • Jul 2007
          • 104

          #5
          Originally posted by Killer42
          Great! Glad we could help. :)
          Hi Killer 42,

          I have posted another question about VB6 button opeining a web page of choice. Is this function not possible?

          Thanks

          Comment

          Working...