-
May 16th, 2005, 05:57 AM
#1
Banned
using autoexec.bat files
I have a pen drive with some songs/doc/misc stuff on it and I have to use it to swap information from 2 different computers in my room. I was wondering if i could simply write an autoexec.bat file that when I plug the pen drive in, it automatically copies certain files to a specific location. Say the desktop for instance.
I have very limited experience in batch writing, so if anyone can help me out i would appreciate it a ton.
Thanks
-Any
-
May 16th, 2005, 07:21 AM
#2
What o/s do you have?..Drag and drop it or copy and paste in any windows o/s.I mean if you have to put the (pen drive)?..I take it that this is a flashdrive..You have to insert that anyway so I don,t think it is a lot of effort to copy and paste anyway.It auto mounts in xp or install software on 98 etc..
Do you have a specific reason for wanting to do that??
Practise what you preach.
-
May 16th, 2005, 08:55 AM
#3
Another lazy boy is here ....
The following link contains the commands you will need to perform the task you asked about .... this link will cut the corners and make it easier to write the sought file .... remember .... you have to practice in order to attain a clear and bebficial experience in the industry ....
http://labmice.techtarget.com/articles/batchcmds.htm
cheers
\"The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards - and even then I have my doubts\".....Spaf
Everytime I learn a new thing, I discover how ignorant I am.- ... Black Cluster
-
May 16th, 2005, 01:22 PM
#4
Hi
A little comment: I propose part of a solution here, which I
find very convenient. I use the AutoRun[1] functionality. I
assume you are using Windows XP (SP2)or similar. You can
enable it (if not by default) by using a little registry tweak[2].
AutoPlay and Drive's context menu
My USB-sticks are creating entries in the context menu of the
drive (check using "My Computer"-environment). Each stick has
a Autorun.inf-file in the root directory, containing something like
Code:
[autorun]
action=Run AutoStart.Exe
icon=wireless.ico
label=Wireless Tools
open=autostart.exe
shell=search
shell\search=&Search
shell\search\command=search.exe
shell\enum=&Enum
shell\enum\command=enum.bat
Explanation
action, icon, label and open is a default set for AutoPlay.
Action creates an entry "Run AutoStart.Exe" in the AutoPlay menu,
an icon and label is assigned to the drive's properties and
with "open" a command is provided, here AutoStart.Exe will
be executed.
One can also control the double- or right-click on the drive's symbol
(again: check via "My computer"-environment).
will provide the default "command" performed by a double-click.
shell\search defines such a command:
Code:
shell\search=&Search
will create the context-menu entry "Search". The context-menu is
activated using the right-click. By clicking on the context-menu entry
Code:
shell\search\command=search.exe
will be executed . You also can execute batch-files - write one to copy
the files onto or from the Desktop[3] (...) .
I provided this kind of information, because the AutoRun/Play
capabilities might come in handy for some of you - note, it
should be in the responsibility of an administrator in schools,
libraries or publicly available computers to disable USB drives
and other removable medias, as far as possible.
Cheers.
[1] http://msdn.microsoft.com/library/de...oplay_cmds.asp
[2] http://autorun.moonvalley.com/enable.htm
[3] http://www.antionline.com/showthread...hreadid=268186
If the only tool you have is a hammer, you tend to see every problem as a nail.
(Abraham Maslow, Psychologist, 1908-70)
-
May 22nd, 2005, 05:18 PM
#5
Banned
this was pretty helpful, im glad i stopped by to read it. well done
-
May 23rd, 2005, 02:48 AM
#6
Re: using autoexec.bat files
Originally posted here by Any
I have a pen drive with some songs/doc/misc stuff on it and I have to use it to swap information from 2 different computers in my room. I was wondering if i could simply write an autoexec.bat file that when I plug the pen drive in, it automatically copies certain files to a specific location. Say the desktop for instance.
I have very limited experience in batch writing, so if anyone can help me out i would appreciate it a ton.
Thanks
-Any
I tell you what, since I don't know your specific directories, I'll show you a place where someone will write one up for you. http://www.windowsshellscripting.com/ Navigate from here to "Question & Answer Board" *****Enlist the help of Forum Moderator ElvisIncognito & docrice. ***Tell them pbarrette sent you.
The book on the front page is called Windows NT Shell Scripting by Timothy Hill. That book is like the bible for this stuff. It will make configuring NT a lot easier and quicker. I own it and I've scanned the autoexec.bat page for you. Attached below.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|