Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Self Reference File Name Command?

  1. #1

    Thread Starter
    Fanatic Member Vectris's Avatar
    Join Date
    Dec 2008
    Location
    USA
    Posts
    941

    Resolved [RESOLVED] [2005] Self Reference File Name Command?

    In this program that I'm making, it renames itself to a random string of like 8 characters every time it runs. Previusly I've been using a registry key to keep the new name that it was named to in order to know what file to rename to change it next time.

    What I wanted to know is if there is a sort of "Self Reference" Command for renaming or just getting the name of the file. Now I'm not talking about Me. with forms and stuff, this is about the .exe name. I've looked and looked and haven't come up with anything, does anyone know a command/function to get the name of the program while it's running itself?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Self Reference File Name Command?

    IO.Path.GetFileName(Application.ExecutablePath)
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] Self Reference File Name Command?

    OK.... I'll ask...

    In this program that I'm making, it renames itself to a random string of like 8 characters every time it runs.
    WHY on Earth would you want to do that? Last time I built something that did that, was some 20 years ago for starters, was when I was tinkering with making viruses for experimental purposes.....

    -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??? *

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