![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject[>>] [<<]Thread[>>]
Number : 3215 Date : 2002-12-09 Author : Kan Yabumoto Subject : Re: Installing XXCopy Size(KB) : 6
Dennis: The key to making a program like XXCOPY.EXE readily available for execution in a DOS Box is to master the rules that governs the selection of the intended program in the environment. The key is in the environment variable, PATH. First, open up a DOS Box and run the SET command (without arguments). You will see 20-40 lines of text which starts like COMPUTERNAME=MJORDAN ComSpec=C:\WINDOWS\system32\cmd.exe HIMEDRIVE=C: ... PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;... ... SystemDriveC: ... If you run the PATH command, it will show just the line related to PATH. The right hand side of the PATH= is a list of directories that are separated by a semicolon which is the so-called "path" for execution order. A DOS Box is controlled by the command processor (the program which is running the show for the DOS Box --- in the case of WinXP, it is the CMD.EXE program ---- it is COMMAND.COM in case of Win95/98/ME). That is, the command line you type in and also lines in a batch file are controlled by the command processor program. The line you type in (-- you may edit using the backspace or del character, etc.) will eventually be interpreted by the command processor program as soon as you type the Enter (Carriage return) key. The command line will first be broken down into parts which are separated by the space (and tab) character. The first word is the most important one. If you type ABC as the first word (without a full path like the one in your example), the command processor will search various directories on your system by the following order to find a match. 1. the current directory of the current drive 2. the directories that are declared in the PATH environment variable (as in the example above, C:\WINDOWS\system32\ is the fist one followed by C:\WINDOWS\ directory and so on. Each of the directories is checked for the following filename: ABC.COM ABC.EXE ABC.BAT in this order. The first file that matches the name will be selected for execution. ---------------------- Now, with respect to the way XXCOPY installs, the traditional way for a program to make a bullet-proof installation was to set aside its own "home" directory and modify the PATH environment variable which will include the application's home directory path. That is, we could have followed this traditional installation method. 1. create a hard-coded directory such as C:\XXCOPY\ 2. and put all XXCOPY-related files into this directory. 3. programatically edit the AUTOEXEC.BAT file where the PATH= is defined so that when the computer is booted the next time, the system will always put the C:\XXCOPY\ name into the environment variable, PATH. This technique was acceptable when you had only a few such applications. But, it is now not practical to have each application to append its home directory path into the environment variable PATH since it will become too long. Since the environment variable consumes the limited memory space (out of the 640KB memory block and the upper limit for the total environment variable space is fixed --- usually much less than 8KB -- often something like 2KB), if XXCOPY ads its home directory to the environment variable, PATH, it will be viewed by most users a pollution of the system. Besides, XXCOPY consists of only a handful of files that it is probably quite permissible to have XXCOPY files placed into the \windows\system32 directory (or \windows\command\ in case of Win9X) although some purists may be offended. So, what we chose to do was not to add any new directory into the existing set of directories in the PATH. XXCOPY makes a wild guess (but quite a reasonable one) that in nearly *ALL* Windows environments, the X:\Windows\ and X:\Windows\system32\ directories (the name "Windows" could be anything that you choose to name at the time of your Windows installation) are listed in the PATH environment variable. At the time of XXCOPY /INSTALL execution, XXCOPY will ask the system for the current setting of the windows system directory and make it the default place to transfer all the XXCOPY files. The reason why you need to type I:\WINDOWS\system32\XXCOPY to run is because at the time you installed XXCOPY, XXCOPY learned that the I:\WINDOWS\ directory was the windows system directory and chose to make the I:\Windows\system32\ directory as its home (remember XXCOPY asked your permission to do so and also gave you an alternative place to call its home). So, what to do now? 1. Boot your Win XP Pro as you normally start up your computer. 2. Copy all XXCOPY related files into a temporary directory (C:\XXTEMP\ if you don't have it). and unzip the downloaded files into the directory. XXCOPY.EXE XXCOPY16.EXE XXPBAR.EXE XXCOPY.LIC ---- delivered by Email separately 3. Open a DOS BOX and make it the current directory of the current drive. C: cd c:\XXTEMP 4. Run the following command xxcopy /install XXCOPY will copy all the files into the proper place (if your current WinXP's system directory is at C:\WINDOWS, it will choose C:\WINDOWS\SYSTEM32\ as XXCOPY's new home). Make sure you delete the temporary directory (C:\XXTEMP) after all that. It is also a good idea to purge all "XXCOPY.EXE" files from your system (rename if you have older versions). Now, if your system does not have C:\WINDOWS\SYSTEM32 listed in the environment variable, PATH --- assuming C: drive is the WinXP's home), your system is weird. You could reconfigure your environment whatever you want. But, you should know what you are doing before making your system different from the "common" settings. I would not waste my time removing C:\windows\syste32 from the PATH settings because I know there are hundreds of programs that operate under the reasonable assumption that the directory is listed in the PATH. Alternatively, you may skip all the above re-installation and add the I:\WINDOWS\system32 directory into the PATH setting of your DOS Box; do the following: Control_Panel > System > Advanced > Environment Variables In the second list box (System variables), highlight the line that stars with "Path" and click [Edit]. Then, type right-arrow (to unselect all and place the cursor at the rightmost position) and type the following line (without Enter key) I:\WINDOWS\system32; And, click [ OK ]. and [ OK ] once more. And [ OK ] to exit from the System Property. Now, you are all set. Open up a new DOS Box and type PATH, and you should find the I:\WINDOWS\system32 in the PATH settings. Now, you can type XXCOPY /HELP and you should find XXCOPY running without any qualifying path in front of it. Kan Yabumoto ======================================================= At 2002-12-08 13:39, you wrote: >When running a batch file using XXcopy I cannot use just, > >xxcopy (whatever) > >I have to use the full path I:\WINDOWS\system32\XXCOPY (whatever) > >This is XP PRO and I did use the install.bat. > > >-- >Dennis
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.