Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Visual Basics Searching for File on any computer
New Posts  All Forums:Forum Nav:

Visual Basics Searching for File on any computer

post #1 of 6
Thread Starter 
Visual Basic 6
So I'm making an installer for a friend who isn't to good with computers to make it easier for him..dot.. But I'm having a little trouble... When I make the program search for the file I wish to open, I would normally type E:\\file\\file\\ext. But after bringing my USB to school today I released that not all computers call their removable disk (E:/)... So when I opened the installer it didn't work, it said the file wasn't found...

So what I'm wandering is if there is a line of code I can use that will search the entire computer or maybe a code like removabledisk:\\file\\file\\file that will only search removable data basses??? really stuck on this, and obviously it being an exe, I can't change it at school on the computers we're installing them on, unless I save the form :3 yes that's right.... MineCraft FTW
Edited by gamingowiz - 2/21/11 at 4:47am
DEVILS ANGEL
(13 items)
 
 
CPUMotherboardGraphicsRAM
i7 2600K ASUS Maximus Extreme IV p67 ASUS DIRECT CU II 7950 Corsair Dominator 12GB  
Hard DriveHard DriveMonitorKeyboard
OCZ 60GB SSD Westurn Digital 1TB 3 x SyncMaster p1950 (eyefinty) Corsair k90 
PowerCaseMouseMouse Pad
Silverstone Straeder Gold 850 Watt Corsair 800D Corsair M60 Razer Goliathus 
Audio
Accousound px23 Amp 
  hide details  
Reply
DEVILS ANGEL
(13 items)
 
 
CPUMotherboardGraphicsRAM
i7 2600K ASUS Maximus Extreme IV p67 ASUS DIRECT CU II 7950 Corsair Dominator 12GB  
Hard DriveHard DriveMonitorKeyboard
OCZ 60GB SSD Westurn Digital 1TB 3 x SyncMaster p1950 (eyefinty) Corsair k90 
PowerCaseMouseMouse Pad
Silverstone Straeder Gold 850 Watt Corsair 800D Corsair M60 Razer Goliathus 
Audio
Accousound px23 Amp 
  hide details  
Reply
post #2 of 6
It would be easier to make it relative to your application.
EX> simply calling 'file.ext' would automatically begin searching in the same directory as the VB app.
Waiting on X399
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II B57 @ X4 3.9 Gigabyte 790FXTA-UD5 Sapphire Radeon 290 8 GB G.Skill 2133 
Hard DriveCoolingOSKeyboard
250 GB 840 EVO Noctua NH-D14 Windows 10 Logitech K350 
PowerCaseMouseMouse Pad
Seasonic x750 Corsair 600T Logitech G100s Razer Goliathus Speed 
Audio
Plantronics Gamecom 788 
  hide details  
Reply
Waiting on X399
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II B57 @ X4 3.9 Gigabyte 790FXTA-UD5 Sapphire Radeon 290 8 GB G.Skill 2133 
Hard DriveCoolingOSKeyboard
250 GB 840 EVO Noctua NH-D14 Windows 10 Logitech K350 
PowerCaseMouseMouse Pad
Seasonic x750 Corsair 600T Logitech G100s Razer Goliathus Speed 
Audio
Plantronics Gamecom 788 
  hide details  
Reply
post #3 of 6
Thread Starter 
Quote:
Originally Posted by beers View Post
It would be easier to make it relative to your application.
EX> simply calling 'file.ext' would automatically begin searching in the same directory as the VB app.
I think I know what you're saying here, but not sure if it's the answer to my question, do you mind explaining it more in detail ,I'm an dumbass
DEVILS ANGEL
(13 items)
 
 
CPUMotherboardGraphicsRAM
i7 2600K ASUS Maximus Extreme IV p67 ASUS DIRECT CU II 7950 Corsair Dominator 12GB  
Hard DriveHard DriveMonitorKeyboard
OCZ 60GB SSD Westurn Digital 1TB 3 x SyncMaster p1950 (eyefinty) Corsair k90 
PowerCaseMouseMouse Pad
Silverstone Straeder Gold 850 Watt Corsair 800D Corsair M60 Razer Goliathus 
Audio
Accousound px23 Amp 
  hide details  
Reply
DEVILS ANGEL
(13 items)
 
 
CPUMotherboardGraphicsRAM
i7 2600K ASUS Maximus Extreme IV p67 ASUS DIRECT CU II 7950 Corsair Dominator 12GB  
Hard DriveHard DriveMonitorKeyboard
OCZ 60GB SSD Westurn Digital 1TB 3 x SyncMaster p1950 (eyefinty) Corsair k90 
PowerCaseMouseMouse Pad
Silverstone Straeder Gold 850 Watt Corsair 800D Corsair M60 Razer Goliathus 
Audio
Accousound px23 Amp 
  hide details  
Reply
post #4 of 6
Not sure if it would be viable for your application, but:

If you were to write source code that only looks for a filename and does not have a path specified, VB will automatically assume you are referring to the directory where the .exe file which you compile is located.

Therefore, if you say "superminecraft.cfg" as the path/file, and you save your final compiled program file onto E:\\supersecretfolder\\omgvisualbasic.exe , once you run the program, it will automatically search for E:\\supersecretfolder\\superminecraft.cfg once you reach that part of the code.

Also, why haven't you upgraded to Visual Basic 2010 Express yet? It's bloody free!
Waiting on X399
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II B57 @ X4 3.9 Gigabyte 790FXTA-UD5 Sapphire Radeon 290 8 GB G.Skill 2133 
Hard DriveCoolingOSKeyboard
250 GB 840 EVO Noctua NH-D14 Windows 10 Logitech K350 
PowerCaseMouseMouse Pad
Seasonic x750 Corsair 600T Logitech G100s Razer Goliathus Speed 
Audio
Plantronics Gamecom 788 
  hide details  
Reply
Waiting on X399
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II B57 @ X4 3.9 Gigabyte 790FXTA-UD5 Sapphire Radeon 290 8 GB G.Skill 2133 
Hard DriveCoolingOSKeyboard
250 GB 840 EVO Noctua NH-D14 Windows 10 Logitech K350 
PowerCaseMouseMouse Pad
Seasonic x750 Corsair 600T Logitech G100s Razer Goliathus Speed 
Audio
Plantronics Gamecom 788 
  hide details  
Reply
post #5 of 6
In VB6, to search all drives you need to look at enumerating drives then performing the search on each drive that is of the type you require.

hint: GetLogicalDriveStrings

However, I don't think that is your issue though, if you are writing the installer yourself simply include a browse to target to install in the installer then create shortcuts etc from there.
Edited by Sunriselad - 2/22/11 at 2:03am
    
CPUMotherboardGraphicsRAM
I7 920 Gigabyte EX58 XFX Radeon 4870 X2 6GB Corsair 
Hard DriveOptical DriveOSMonitor
500GB Maxtor LG DVDRW Vista Ultimate x64 2 x Edge IO 22" 
KeyboardPowerMouseMouse Pad
Razer Arctosa XFX 800w BTC Cheetah Gaming Mouse None 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
I7 920 Gigabyte EX58 XFX Radeon 4870 X2 6GB Corsair 
Hard DriveOptical DriveOSMonitor
500GB Maxtor LG DVDRW Vista Ultimate x64 2 x Edge IO 22" 
KeyboardPowerMouseMouse Pad
Razer Arctosa XFX 800w BTC Cheetah Gaming Mouse None 
  hide details  
Reply
post #6 of 6
I don't understand the reasoning behind this program.

You want a program to run to run a .exe? Why not just have the friend run the .exe?
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Visual Basics Searching for File on any computer