Computing.Net > Forums > Programming > Need some help batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Need some help batch file

Reply to Message Icon

Name: worldlibrary
Date: May 1, 2009 at 12:02:16 Pacific
OS: many
CPU/Ram: 1.4
Product: Dell / 4600
Subcategory: Batch
Comment:

Hope someone has a minute.

1.
I am using a usb flash drive.
The drive letter will change from computer to computer, so i need a varible...to do the following

2.
I want to copy a safety.odt to a desksk top
win 2k and xp...from the flash drive

3. I want to update files on usb flash drive from server at \\gfgcf\loadset gfgcf_xp_loadset_cd to usb loadset dir.

Thank you for your time



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: May 2, 2009 at 04:14:50 Pacific
Reply:

It seems the first hump to get over is finding the drive letter for the flash. The volume serial is assigned when the drive is formatted and usually won't change.

================================
:: get letter of flash drive by vol
@echo off > newfile & setLocal EnableDelayedExpansion

for %%d in (d e f g h i) do (
vol %%d: > nul 2> nul
if !errorlevel! equ 0 (
for /f "tokens=5 skip=1" %%s in ('vol %%d: 2^> nul') do (
if %%s equ 90E7-569C set FD=%%d:
)
)
)

echo flash is !FD!


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: worldlibrary
Date: May 2, 2009 at 19:07:38 Pacific
Reply:

Thank you for the reply and the bat.
I have copied and pasted it as tomorrow.Sunday I am going into the foundation to do some work and will check it out.

The reason for this is there are a number of volunteers...with flash drives and they need to be able to update the programs on the drives.

Trying to make life as simple as possible.......If a person gives 8 hrs a week freely to build computers for kids , the least one can do is make it simple to get the programs that are to be loaded easy to update..

Thank you again,

W.L.


0
Reply to Message Icon

Related Posts

See More


.bat to seperate records ... Batch file to sort by fil...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Need some help batch file

Mechanix2 - Ping Batch File Help www.computing.net/answers/programming/mechanix2-ping-batch-file-help/15252.html

Batch file help www.computing.net/answers/programming/batch-file-help/11256.html

Batch file commands help ! www.computing.net/answers/programming/batch-file-commands-help-/16201.html