Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Filepath and create directories from it

Status
Not open for further replies.

ghloid

IS-IT--Management
Mar 11, 2002
85
US
Please excuse my ignorance of good VB lingo. I've used VBA before but it's been awhile, and I'm currently up to my ears in JavaScript, so VB is further down my list of understanding right now.

At any rate, I'd like to create a VB executable that can check for the filepath of a given filename, then create that path on different drive (a floppy drive). This routine should work by simply enacting the executable. So, it should be like this:

User enacts executable and the executable searches the drive for a prespecified filename ("glob.js" in my instance). When it finds the file, it should retrieve the path and save the file with the path structure to the users floppy drive (simply replace the c:\ with a:\ I figure).

I think this can be done with a getFilePath statement or something, but I'm rusty with VB.

Also, I'd like to further complicate things by trying to then reverse the process. That is, copy the file from the floppy drive using the path created back to the C drive. Essentially, this would be putting the file back where it was found.

Hope this one can be done. Any help is greatly appreciated.

THANKS!!!!
 
Just to get it straight... you don't know where this file exists? Will the file always be the same or do you need a way for the user to input it?
 
You're on the money. The filename will never change. It's always going to be statically named "glob.js" (which can be put in the code of course). Just got to find where that file is on the hard drive (it's always on the hard drive too).

AND, in further thinking about this, perhaps there's a way I can code that path name into some sort of global variable. Something that can be called once the executable is run. For instance, if you were to create the executable to search for the filepath then put that file path in a variable that can be "stored" somehow. That way, the next time you run the executable, you could just use that variable for the path name. I don't know, maybe that's too complex.

Thanks for your help so far though!! I think you've got the right idea. I'm trying to look at it too. So far, not much to show.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top