(Msg. 1) Posted: Mon Jun 05, 2006 4:05 am
Post subject: copy to "My documents" from Batchfile
I am trying to make a program run from a USB pendrive,
and the program must copy a folder to "My Documents" folder.
I would like to create a batch file that will findout if "My Documents" is in the default location or has moved, and then copy the folder.
Is this posible to do from a Batchfile ??
(Msg. 2) Posted: Mon Jun 05, 2006 6:57 am
Post subject: Re: copy to "My documents" from Batchfile [Login to view extended thread Info.]
pmo wrote:
I am trying to make a program run from a USB pendrive,
and the program must copy a folder to "My Documents" folder.
I would like to create a batch file that will findout if "My Documents" is in the default location or has moved, and then copy the folder.
Is this posible to do from a Batchfile ??
TIA Peter
You can use environmental variables to find out the default locations
Use the cmd program and type SET
you can pipe this to a file by typing set >file.txt
and then the variable names can be used in any batch file
such as
%USERPROFILE%
is the username logged on
Just remember that directories or file names with space in them
require that you enclose them in quotes as dos treats spaces as
delimiters.
so
dir %userprofile%"My documents"
should give you a listing of the files in your my documents folder.
the "'s are required because of the space in my documents.
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum