Pronunciation / adjective
Bringing something good and unforseen.
    Skip Navigation Links > Tech Blog
   

Share an External USB Drive Connected to a Windows Vista Computer



 

  3/31/2009 3:41:54 PM

Share an External USB Drive Connected to a Windows Vista Computer

Permalink

I use an external USB Drive connected to my Windows Vista desktop computer for backing up files. I also wanted to be able to back up files directly to the same drive from other computers on my network. But if you share an external USB Drive connected to a Windows Vista computer the share will be forgotten if the drive is removed or if the computer is re-booted. To permanently share a USB Drive connected to Windows Vista a .cmd script may be written and then run via Scheduled Tasks each time the computer is booted up. Here's how:

• First open Notepad and enter the following text:

NET SHARE [sharename]=E:\ /GRANT:[user],[READ | CHANGE | FULL] /USERS:[number]

Where [sharename] is the name you want to give the share such as \\MyNetworkedComputer\MyShareName.

[user] is the Username of the account that should be able to access the share.

Pick READ, CHANGE, or FULL for the access permission (probably full if being used for backups).

And [number] is the number of accounts that should be able to access the share at the same time.

I share my entire I:\ drive which is an Iomega brand external USB Drive and my file looks like this:
NET SHARE Iomega=I:\ /GRANT:MyUserName,FULL /USERS:1

Save the file to the location of your choice.

• For the next step you'll need to have windows set to show you file extensions. To do so open an explorer window and choose "Tools - Folder Options" from the menu. (To see the menu in Windows Vista press the "Alt" key.)

On the "View" tab uncheck the "Hide extensions for known file types" checkbox.

Uncheck Hide extensions for known file types

Next right click on the text file you just created and choose "Rename". Change the file's extension from ".txt" to ".cmd" I called my file: ShareDrive.cmd

• To test if the file works right click it and click "Run as Administrator". A command prompt will open and quickly close. After it runs navigate to "Computer" in explorer and you should see a share icon over the chosen drive letter.

• To set the script to run whenever the computer boots up / restarts Scheduled Tasks works well. The easiest way to open the Task Scheduler is to click your "Vista Button" on the start menu and type "Task Scheduler" into the search box. Then click "enter" and the Task Scheduler program will start.

• In the "Actions" pane on the right click "Create Task..."
Create Shared Drive Task Screenshot

• On the "General" tab give your task a name and, if you want, a description. Also set the task to run whether you are logged in or not and to run with highest privileges.
Create Shared Drive Task - General Tab Screenshot

• On the "Triggers" tab click the "New" button and in the window that opens pick "At startup" in the "Begin the task:" drop down list. Then click "OK".
Create Shared Drive Task - New Trigger Screenshot

• On the "Actions" tab click the "Browse" button and browse to the file you created earlier. Then click "OK".
Create Shared Drive Task - New Action Tab Screenshot

• Check if you want to change anything on the "Conditions" or "Settings" tabs, but the defaults should be fine. And then when you're ready click "OK". You will now be prompted for an Administrator Password. Enter that and you're done.

• To test if the script works, restart your computer. After the restart has completed navigate to "Computer" and you should see that your drive is "still" shared.
<March 2009>
SuMoTuWeThFrSa
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234


Microsoft Certified Professional   © 2013 Fortunate.  All rights reserved.
contact: justin@aboutfortunate.com