[<<]Message[>>]    [<<]Author[>>]    [<<]Subject[>>]    [<<]Thread[>>]

Number : 4749 Date : 2003-06-04 Author : Kan Yabumoto Subject : Re: xxcopy to CD-RW Size(KB) : 2
Garry wrote: > Kan, I overlooked that the previous code is not > totally bulletproof. Thank you Garry for your generous help with the very good batch file code you showed me. I just verified the code in XP and Win98SE. As to the situation where the user type "install" and another program (or batch file) which qualifies to be invoked due to the particular path setting, it is definitely beyond the scope of the batch file. Of course, we see more and more people who do not appreciate how the PATH= setting works. It is clearly beyond the scope of what we should provide. That is, the code you supplied already handles the fairly common "mistake" of user double-clicking the INSTALL.BAT icon from the Windows Explorer. The code you suggested earlier is quite sufficient in my view. The "problem" you are trying to address by the much longer script is a result of totally unreasonable operation on users part. If the user has no idea what the PATH= setting does, there is no hope that he can manage executing the proper copy of the XXCOPY.EXE file. I'm always amazed that people like you can create a bullet-proof batch script like that. One solution is to provide a more unique name than "INSTALL.BAT". But then, typical (experienced) user would have hard time guessing which one in the unzipped files in the temporary directory. As I said earlier, the solution should be fairly "elegant". Although the new and much longer version may close the hole for the rare case, the sheer length alone disqualifies itself. That is, I have hard time following the batch script (mostly my lack of mental energy to fully comprehend what is going on in the batch file). When, the script become too long, it would be understood only by a very few advanced users only. One benefit of the batch file is that it is a "well-understood" rules which most people can follow by just looking at it. When the required action for the very rare cases makes the batch file much longer, then, the benefit evaporates. So, I'm just about ready to incorporate your first suggestion (which is very elegant and works well). I'm thinking about putting a text which gives you the credit for the code if you don't mind (If you have objection, I will not put your name in it). The first section of the batch file will look like this: install.bat --------------------------------------------------------------------------- echo. echo *************************** echo * XXCOPY INSTALL SCRIPT * echo *************************** echo. if "%OS%"=="Windows_NT" ((cd /d %0\..)&(goto next)) %0\ cd %0\.. :next echo The current directory is: cd :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: The above section was suggested by Garry Deane, a veteran XXCopy user. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: echo. ---------------------------------------------------------------------------- Again, thank you for your great help. Kan Yabumoto
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.