Forms :: Determine A Dynamic Drive Letter For A Directory On The Removable Drive And Then Open That Directory In An Explorer Window
Feb 19, 2009
First off a short background of the project I am working on- I am developing a program that will be run off removable media (i.e. USB Flash drive). This will be a �virtual desktop� which you will be able to take with you and have the same �desktop� on any system. As we know drive letters can change with each host system the drive is plugged into, I need to be able to determine the path for the flash drive and access a specific folder ( i.e. My Documents)
I have an picture box(representing the icon) placed on my form (form1) and when I click the icon I want to be able to open and view the a specific folder from the portable drive. I need a click event that will determine a dynamic drive letter for a directory on the removable drive and then open that directory in an explorer window.
[Code]....
View 1 Replies
ADVERTISEMENT
Mar 11, 2010
I have made a program that i would like to be able to move from PC to PC; at the moment i would have to change the string directories within the program for each PC i would like top run it on.
By having the user select their drive letter and type their account name into a text box could this be implemented into a directory.
Below is the code, as i was hoping it was coded (lol never is tho).
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Filename As String = ("*.torrent")
[Code]......
View 4 Replies
Oct 31, 2011
I am new to VB and playing with a program to display disk info attached to my PC. I have used WIN32_DiskDrive & WIN32_LogicalDisk to gather info regarding volumes, disks and partitions.
What I want to find how is how to relate the Device Index and Partition # back to a volume (ie with a drive letter).
View 2 Replies
Feb 19, 2012
I'm running the following WMI script to get the associations between drive letters and physical drives on the system, but for some reason it omits CDROMs/DVD-ROMs. Can someone tell me how to get those as well?
Code:
ComputerName = "."
Set wmiServices = GetObject _
("winmgmts:{impersonationLevel=Impersonate}!//" & ComputerName)
Set wmiDiskDrives = wmiServices.ExecQuery _
("SELECT DeviceID FROM Win32_DiskDrive")
[Code3]...
View 12 Replies
Jun 16, 2009
I have a program that allows the user to enter a drive letter into a text box. The program then takes the letter and find the physical drive number (i.e. deviceharddisk3..). It then stripes out everything and leaves me with the number 3.
In VB6 I used mDrive.bas from vbAccelerator.com and it worked perfectly. I have been all over the internet and back and cannot find a solution written in VB.NET.
View 14 Replies
Oct 13, 2009
I want to make a tool that will assign a USB pen drive a drive letter, I am using WMI to acknowledge the device being plugged in, I can pull the deviceID, name, etc now I just need to work out how to assign the device to a drive and I just cant figure it out
View 4 Replies
Jun 17, 2009
I am trying to get the physical drive (device) number from the drive letter. If the user inputs the drive letter C the program will find the associated physical device number. For example if I input C then the result needs to be \Device\HardDrive1\... Some call it NT Device Name; I think. I have the code for VB6 from vbAccelerator, which works perfectly, but it does not work in VB.NET. My question is there a simple way of pulling the drive info that contains the drive letter and the physical device number. I have searched the internet and found nothing for VB.NET. I would post code but I have nothing for .NET.
View 1 Replies
Jun 16, 2009
I have a program I am converting from VB6 to VB.NET and I am stuck at the very last piece of code. I need to determine what physical device number is associated with the drive letter.
The program takes the drive letter from a text box and goes and finds the device number (i.e. deviceharddrive3...) and strips out everything leaving me with the devicer number; in this case the number 3. I have searched the internet to and fro and found nothing in VB.NET.
My program in VB6 uses a .bas module from vbaccelerator.com called mDrive.bas and works great. I can't figure out how to convert it over to VB.NET.
View 6 Replies
Mar 12, 2010
i was wondering if there is any way to read from a file in the application directory without specifying the drive letter. Here's what i have:Dim var var = My.Computer.FileSystem.ReadAllText("c:appdirectoryfilename")
If i leave off 'c:' it looks for it in system 32 or something. why can't i just say
ReadAllText("filename")
View 6 Replies
Dec 10, 2008
Does anyone know if there is a way to determine if a drive is local or a network drive?
View 1 Replies
Apr 27, 2010
i am trying to create a directory in drive C: (at a win7 target machine) withirectory.CreateDirectory but so far no luck.I believe the problem has to do something with permissions-security... So here i am..
View 3 Replies
Mar 12, 2011
I am using the following code to get a list of the letters for each drive on my computer. I want to get the drive letter of CD Drive from this list. The code I am using to get list is as below:
[Code]...
View 2 Replies
Jan 2, 2010
I have a function that copies files from a CD to my HDD:CopyFiles(CD_Drive, FullPath & "")
The problem is that the Drive letter "I:" is not consistent. Sometimes when I connect and disconnect external devices, the CD Drive letter changes and then my code doesn't work unless I open the project, change the letter "I" and recompile.What code can I use that will ALWAYS detect my CD Drive, regardless of the drive letter? (Like for instance, NERO will detect and burn CDs regardless of the drive letter)
dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf'
dp.SyntaxHighlighter.HighlightAll('4e1b98200b534bcfb11430c4ef5e5987')
View 3 Replies
Oct 6, 2010
[code] i need to find a way to loop through ALL the directory's on the "c" drive and not just the main folder.
View 4 Replies
Oct 6, 2010
i have this piece of code:
[Code]....
and it works just fine. However, saying that, i need to find a way to loop through ALL the directory's on the "c" drive and not just the main folder. Does anyone have any code that can do that?
View 2 Replies
Mar 9, 2012
have this piece of code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strFileSize As String = ""
[code].....
View 6 Replies
Oct 13, 2010
I have a program that allows the user to choose from 100's of .rtf files and .loadfile them into an rtb. When I build and then deploy the program (version1.0) how are the files that pre-exist on my drive end up available on the users drive to be able to load them from the specified directory? Do I need to make the .rtf files a resource? Or is this process simply "done" when user installs app? By the way, I am using Visual Studio 2008 (Visual Basic).
View 5 Replies
Oct 6, 2010
i have this piece of
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strFileSize As String = ""
Dim di As New IO.DirectoryInfo("C:")
[code]....
and it works just fine. However, saying that, i need to find a way to loop through ALL the directory's on the "c" drive and not just the main folder.
View 5 Replies
Jun 6, 2011
I'm quite new to programming and I am working on a project. The aim is to automatically run a backup process once a removable drive is inserted.So far I've been using this piece of code[code]....
This obviously only runs once unless I use a loop or timer, however both of those will cause the backup process to loop as well.
View 6 Replies
Oct 27, 2011
In this question I'm using Visual Studio 2008. My code is quite simple, as it was used from a reference I grabbed off the web. I'm using ASP/VB.Net, IIS6.0 on a Windows Server 2003 box.I've looked at various sources online, and have not been able to piece together a proper result. The purpose of this is to list a slew of directories and their respective files, and allow the user to eventually manage that directory (such as open and delete files).
Here is my ASPX page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DirectoryList.aspx.vb" Inherits="VCMReports.DirectoryList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
[code]....
When launching the page, the following error appears: 'V:Users' is not a valid virtual path. Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: 'V:Users' is not a valid virtual path.
Things I have tried:
On the server, I have mapped out the drive and the directory.Permissions seem to be properly set, impersonate is correct.If I were to list a directory in the actual directory "C:InetpubDirectory", there is no failure.I do understand this is incomplete for the Directory listing portion, this will only list files (so this will need to be modified.I have attempted to create a Virtual Directory, and the application presented the same error. On my local development machine, I have the same path created - same error. How am I able to view the contents of a shared directory and it's files?
View 1 Replies
Apr 20, 2009
I'm a bit new to VB.NET and I have a database which I want to connect to an access backend stored on a network drive for multiple users. I can view the Database in the solution explorer and the directory defaults to the project folder. How can I specify the directory to pull from my network drive? VS has copied this datasource and imported it locally which is fine for testing, but i need the file accessible for multiple users. Is this something I do when publishing?
View 3 Replies
Jul 12, 2011
I design photo viewer app using this code
[Code]...
now how to make my photo viewer open when user open drive C and get all photo in the drive to be shown in it ?
View 14 Replies
May 1, 2010
how to open an .exe file from a that is in a certain file, what i am trying to do is create a program that will be portable-via jump drive or cd drive, the reason i feel stupid is that I did not realize that visual basic and vb.net are two different animals- I was trying to use app.path for days- then came across a post that set me straight that I can not use it.[code]
View 4 Replies
May 27, 2012
I have a program for which I have developed a user guide. I have placed this user guide within the project directory. I created a MenuStrip Item by which to open the user guide in Word on the user's machine. I was successfully able to do this with the following code:
Try
userGuide = MSWord.Documents.Open("C:UsersadministratorDocumentsVisualStudio2010Project3UserGuide.doc")
MSWord.WindowState = Word.WdWindowState.wdWindowStateNormal
[code].....
The problem is, the path used to open the file will not exist on the users machine. This is a standalone system, so no file share can be created in which to place the document, therefore no common path can be coded.Is there a way to code dynamic paths? Perhaps something like:
userGuide = MSWord.Documents.Open("%windir%UserGuide.doc")
View 1 Replies
Jul 21, 2011
I would like to create thumbnails into a VB (2005 or 2010) form from video files.
I have a directory (in my hard drive) with video files (.mpg).
How to show video thumbnails for each video file?
My VB code (for images) is attached below and I want to convert it in order to manage video files.
Private Sub ThumbButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles ThumbButton.Click
Dim imagepath As String
[Code].....
View 2 Replies
Jul 15, 2010
What are the variables for The system drive (most commonly "C:") and system directory (Most commonly "C:WINDOWS")
View 4 Replies
Sep 16, 2010
I was wondering how do you find all HDD drive letter. I got a code but it will get the dvd drive letter. I only want it to show my all my HDD and USB if there is any connected.[code]...
View 2 Replies
Jun 29, 2011
I find a lot of VB6 examples out there, and a few C# examples, but no concrete solution in VB.NET. Simply put, I need to get the next available drive letter in as few lines of code as possible.
View 2 Replies
Apr 24, 2009
Is it possible to find a drive's letter given one of the following two?
1) SCSI Address (eg 0/0/0)
2) NT Device Name (eg /device/CdRom0)
View 3 Replies
Jan 25, 2011
my question is how to find the drive letter. not all the comps have the same do they.?
View 3 Replies