| View previous topic :: View next topic |
| Author |
Message |
alcamize How do I cheat?
Reputation: 0
Joined: 11 Sep 2007 Posts: 6
|
Posted: Sun May 03, 2009 10:46 pm Post subject: [VB]Drive path |
|
|
First of all W00T THE FORUMS ARE BACK!!!
2ndly I am making a tool with VB that will install firefox, plugins, apps i use etc, well i have all that worked out but I was wondering(cause i'm putting it on a USB) if i could change the path i currently have J:\\ to something that it will look for, say its not that on a diff computer it will look for the files in each drive or watever. So basically I'm asking if there is a way to change the J:\\ to something universal or something it will look for
|
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Mon May 04, 2009 12:12 am Post subject: |
|
|
You aren't being to detailed.
Is the J: the name of the flashdrive path?
Or is it the name of the System Drive?
_________________
|
|
| Back to top |
|
 |
Frostbyt3 Master Cheater
Reputation: 0
Joined: 07 Jan 2008 Posts: 323 Location: Australia
|
Posted: Mon May 04, 2009 12:32 am Post subject: |
|
|
I havent tried it in VB, but I've succesfully used (In C#)
| Code: | | string path = "%WINDIR%\\..\\"; |
to give me the users root drive(drive with windows)
In vb it would probably be
| Code: | dim path as string
path = "$WINDIR/../"; |
So to sum up, I would personally do :
| Code: | string path = "%WINDIR%\\..\\ProInstaller";
InstallApps(path); |
|
|
| Back to top |
|
 |
alcamize How do I cheat?
Reputation: 0
Joined: 11 Sep 2007 Posts: 6
|
Posted: Mon May 04, 2009 4:21 am Post subject: |
|
|
J:\ is the path of the flash drive and the flash drive has the files the app will use, and say I plug the usb into another computer the path might change to K:\, so my question is how could I change
| Code: | | Call Process.Start("J:\\Programs\\Firefox Setup 3.0.10.exe") | to something that will look for that file. or make the J:\\ changable within the app itself
|
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Mon May 04, 2009 9:05 am Post subject: |
|
|
| alcamize wrote: | J:\ is the path of the flash drive and the flash drive has the files the app will use, and say I plug the usb into another computer the path might change to K:\, so my question is how could I change
| Code: | | Call Process.Start("J:\\Programs\\Firefox Setup 3.0.10.exe") | to something that will look for that file. or make the J:\\ changable within the app itself |
Make your program search through its drive...
Hmm, at the top of my head I'd say look into the Directory class.
_________________
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Mon May 04, 2009 9:05 am Post subject: |
|
|
I think App.path will get the path of the application itself. So when your application is on the flash drive, you can do:
| Code: | | Call Process.Start(App.path + "\\Programs\\Firefox Setup 3.0.10.exe") |
You might need to remove the slash before 'Programs' but I'm not sure.
|
|
| Back to top |
|
 |
alcamize How do I cheat?
Reputation: 0
Joined: 11 Sep 2007 Posts: 6
|
Posted: Mon May 04, 2009 1:16 pm Post subject: |
|
|
| tombana I tried your method, but that didn't work; and yoyonerd I am not sure how to search thought a drive but I came up with an idea this morning on the bus, its making a text box that will change the drive path of each of the buttons o.O just not sure how that would be coded
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Mon May 04, 2009 2:22 pm Post subject: |
|
|
| I think App.path is for VB6 and not VB.NET. I wasn't sure which one you were using
|
|
| Back to top |
|
 |
shhac Expert Cheater
Reputation: 0
Joined: 30 Oct 2007 Posts: 108
|
Posted: Tue May 05, 2009 12:34 pm Post subject: |
|
|
| tombana wrote: | | I think App.path is for VB6 and not VB.NET. I wasn't sure which one you were using | in VB.NET it is | Code: | | Application.StartupPath |
|
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Tue May 05, 2009 2:51 pm Post subject: |
|
|
| tombana wrote: | I think App.path will get the path of the application itself. So when your application is on the flash drive, you can do:
| Code: | | Call Process.Start(App.path + "\\Programs\\Firefox Setup 3.0.10.exe") |
You might need to remove the slash before 'Programs' but I'm not sure. |
In VB you dont gotta use \\ just use \
also you can use
| Code: | | shell (app.path & "\Programs\Firefox Setup 3.0.10.exe") |
_________________
|
|
| Back to top |
|
 |
yoyonerd Grandmaster Cheater
Reputation: 0
Joined: 26 Apr 2008 Posts: 699 Location: -->formerly yoyonerd<--
|
Posted: Tue May 05, 2009 8:17 pm Post subject: |
|
|
Ehh, I'd help you but I don't really know VB~
_________________
|
|
| Back to top |
|
 |
|