Jump to content
MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. ×


  • Posts

  • Joined

  • Last visited

  • Days Won

  • Donations

  • Country

    United States

Everything posted by bphlpt

  1. While I respect your frustration, I interpret your references differently, As I read the newspaper, I thought it meant that the "previously planned" part referred to them previously planning to allow tourists in as of August 1, but new data about the severity of continued infections has caused them to reconsider. Your interpretation could be a case of a misplaced coma in the newspaper text. As to the rest of your post, even Twitter itself has marked that tweet as misleading, so... Regarding the software/Green Pass mentioned in the OP, my state is one that has not planned such a thing and I doubt they will unless forced to. While I am vaccinated, I have never been asked to show such proof. I think such passes or software can be a good thing, but because of the worldwide nature of the problem, its use and enforcement needs to be consistent. While I respect states rights, the problem is too wide spread and people from various states and countries interact too frequently. It just doesn't make sense to use anything but a consistent unified approach. What approach is that? I have no idea what it is nor how we can get past the political nature of how this has evolved. All governments seem to be quick to blame anyone else for the problems and take credit for any small improvements. The public has become confused and distrustful. Very disheartening. With the current variants of the virus, and the likelihood of future variants, I can see this situation becoming like the flu vaccine, and maybe even combined with it? Each year a new one will come out, with varying degrees of effectiveness each year. I think that the virus and the flu are different than polio or other diseases. Those other diseases can be treated by a single shot that can immunize an entire population with an extremely high effectiveness. The virus and the flu, based on what I have seen, seem to have too many variants, morph too quickly, and affect folks too differently with their different physiology, ages, and medical histories. We're always going to be chasing a cure like playing whack-a-mole. But I hope I am wrong and an effective vaccine can be found. Cheers and Regards
  2. Site search does not work for me either. But then even when it did work, just using Google to search with a search string something like "site:msfn.org 'search string' " often worked better.
  3. @kasfruit, I respectfully disagree. The question was ''Can my 2006 Laptop use Samsung 860 EVO 500GB SSD?'' NOT ''Can my 2006 Laptop use Samsung Magician?'' To my knowledge, Magician is NOT required in order to use the 860 EVO SSD. Magician might offer some extra optimizations, but they are not required. Please explain, with appropriate references to Samsung documentation, if I am mistaken. While I have used the Samsung 850, 860, and 870 SSDs, it has always been with Win 7. I have not used any SSD with XP, so I could be wrong, but I don't think so. Cheers and Regards
  4. Since this is your first post, and since you don't want to reformat your disk, along with your other questions, I'm tempted to just give you the short answer that with those restrictions that you can't do it. At a minimum, you would need to either use a second disk or a second partition, and typically you install the older OS first. There are some patches for Win 7 available for NVME, but in general, a lot will depend on the EXACT hardware you are trying to use as to whether all the drivers you will need, not just for the drive, are available. As to Win 10 details, I don't know since I don't use it and I hope I will never have to. Cheers and Regards
  5. That was the identifier it gave me as well. Very Strange. (Win7x64, SRWare Iron [Chrome variant] as browser) Cheers and Regards
  6. And a 7th possibility could be a power supply that is just beginning to fail. An iffy power supply could cause the same kinds of flaky performance and random issues as bad RAM contacts or disk cable contacts. Cheers and Regards
  7. In addition to the recommendation to update the RAM, what helped my wife's laptop was to change the HD for an SSD. I was thinking I would have to also do a clean install to really see a difference, but merely cloning her drive to an SSD changed things from being intolerable to being as fast as my desktop system. The laptop is now as much of a joy to use as it was when it was brand new. Absolutely incomparable to the agony it had become. I'm sure a clean install would also help, but currently not necessary. Cheers and Regards
  8. Interesting internal design. I assume the blade is discolored from decades of use? And the plastic "surround" on either side of the blade is meant to protect little fingers? Or is the blade itself also plastic? From your first pic I thought it was rather flat, but it's actually kinda square. Just out of curiosity, it would be interesting to see a pic showing how it interacted with the envelope to be opened. You mentioning a screwdriver version triggered something in my memories. I might have had one like that myself back in the day, LOL Surprisingly, to me, when searching, most "letter openers" seemed to usually be more expensive ($15 -$25 or more) than "knives", all of which I know are WAY more expensive than your el-cheapo one was. But then prices from 1971 are LOONG gone. (gasoline is no longer 35 cents a gallon, but counting inflation I guess $15 today is equivalent to about $3 in 1971) The closest I could find (visually, though flat) was a Traditional Japanese craft knife - "joint" Yoshiharu Kiridashi for wood carving, with a carbon steel blade and brass handle/scabbard. They are relatively inexpensive, $5 - $12, or so, but shipping?? An example of the high end ($12) I found is this one - https://osakatools.com/products/wood-carving-marking-blade-cutter-kiridashi-chisel-craft-knife-yoshiharu-left-or-right-handed?currency=usd. I'm sure yours was probably also made in Japan, the el-cheapo ones usually were back in 1971, but I don't know if we'll be able to find a picture of it now on the web, and thus find out the brand.
  9. Sorry, Den, I don't remember that one. I assume it slides apart to expose the blade? Since my memory failed me, I tried both of Google's image search tools - https://www.google.com/advanced_image_search - and - https://www.google.com/searchbyimage/upload - and Yandex's - https://yandex.com/images/search? - which I've often had more success with, but no luck. The image you provided unfortunately looks too much like various nail files, car reflectors, wax spreaders, leather cutting tools, or Japanese carving blades with brass covers. You might have more success since you know more about the item, or by using different images. Occasionally, using JPG images instead of PNG ones sometimes gets different results. It's always trial and error. Out of curiosity, why are you looking for it? In any case, good luck! Cheers and Regards
  10. Thank you, @hpwamr, for this wonderful reference for sharing files! Might I ask for an additional, and parallel, set of recommendations? That would be specifically for shared images. Some of your above recommendations might be able to fill this request, but different sites might be required. Yes, all of the above would work if you treat the images just as a file, and that's fine, but if you want to share an image that will be displayed in a forum post like you used imgur.com above in the first post of this thread, for example, then different requirements come into play. I can think of a few "requirements" off hand, but there might be others: Direct links to the image must be provided. The image should be maintained as uploaded and not "optimized", degrading its quality. Downloading the image should result in a file with the same file hash as it had when uploaded. The larger the maximum image size allowed, the better, with at least "wallpaper size" as a minimum. Today's availability of 4K and larger screens means that is quite large. A reasonable limit by either dimension or file size is acceptable, but it should be specified. I prefer the image to be displayed as uploaded, others like to use thumbnails. The option for either would be best, with multiple possible thumbnail sizes being ideal. The images should be maintained for as long as possible, preferably indefinitely, and be able to be downloaded and viewed by as many people and as often as desired. The more image formats supported, the better. The site should not require registration, but at the minimum registration should be free. Registration should provide additional features such as file maintenance. Registered free users might have a limit to the number of images allowed, and that's expected as long as the limit is a reasonable one. Extending those limits with a subscription fee should provide additional features in addition to larger capacity. NO spamming, ads, download delays, bandwidth throttling, etc. Forums might impose their own limits to image display, so the image host should have as few of its own as possible so as not to create any bottlenecks. I think it would be great to include this info in this thread as a central reference point for shared files. Using these services helps out all forums regarding the bandwidth and storage space they would otherwise have to support. Many image hosting sites have died over the years, such as TinyPic, so a current set of recommendations would be appreciated. Cheers and Regards
  11. Actually, each post is numbered, (your last post above is comment #1184077), but they are not numbered consecutively. One way to find the post number is to simply hover over the post header, either on the far right where it says "report post" or on the left where it shows the time/date that the post occurred, and then look down in your browser's status bar, or wherever it shows the link address that you are hovering over, to see the post number as the last part of the address of the link. Cheers and Regards
  12. Since @submix8c: was referring to an individual (?), then POS must mean Person of Substance. What that substance is shall remain unsaid. EDIIT: By the way, reboot.pro is back up for me, at lease at this moment.
  13. No disrespect, @dencorso, but like @Wunderbar98, I also agree that it seems that @siriaMIGHT have a point. It is always nice when the developer does what he can to make things easier for the user, especially when that includes adding things that were not included in the original release, or improving things that were. However, also like @Wunderbar98, and you, I agree that "Developers can do what they want" and I also very much appreciate @roytam1's work. So I guess a question might be whether there is any reason NOT to implement the suggestions of @siriaand @Wunderbar98, is it practical to do so, and does @roytam1have the time and resources necessary to do so? ( I realize that there are very valid reasons a developer should not, or might not want to, modify a release beyond a certain point. ) If there is a technical or other practical reason not to implement a requested feature, then that should be that, or if it is just the developer's choice, then we all have to accept that decision as well. But if @roytam1 just hadn't thought about an issue, or hadn't realized how many users might use a particular feature, or lack of one, then he might want to consider implementing it. Now that the requests have been made, we should wait to hear @roytam1's thoughts on the matter. Whatever @roytam1decides, it is definitely up to him and we all MUST accept that, and, hopefully, not complain, at least too much.
  14. Yep. I was also impressed with vcopy: ------------------------------------ Why vcopy? The primary benefit to using vcopy is that it preserves all timestamps and NTFS compression and encryption attributes, when possible. Normally, copy operations will fail to preserve any of the timestamps on directories and the creation and access timestamps on files. Especially in the case of directory timestamps, this default copy behavior wreaks havoc on people who depend on their files and directory trees having meaningful timestamps. You can also suppress and strip out certain file attributes from being copied; for example, the read-only attribute when copying files from a CD-ROM. Additionally, vcopy can compute hashes for files as they are being copied, eliminating the need for a wasteful second read pass. Windows XP (or newer) is required for version 1.4.0 and newer; earlier versions are compatible with Windows 2000. ------------------------------------ Cheers and Regards
  15. I had found a very small and fast program to generate md5 files for files or folders a long time ago, discussed here - https://msfn.org/board/topic/162476-looking-for-a-vbs-script-to-generate-md5-of-a-file/page/2/?tab=comments#comment-1034865 - and mentioned here - https://msfn.org/board/topic/180747-possible-to-do-this-batch-without-using-a-temporary-file/page/2/?tab=comments#comment-1175225, but I couldn't remember where I got it. @jaclazhad found an extremely similar one, but its author was also unknown. Well, I finally figured out where it came from. It is part of a distribution of hashutils - https://code.kliu.org/misc/hashutils/ - made and distributed by Kai Kliu -aka- code65536, so it can definitely be trusted. The version I was using was from hashutils-1.2.3-redist.7z, which is no longer posted on his site, while I assume the one that@jaclazfound was either from hashutils-1.2.4-redist.7z or hashutils-1.3.0-redist.7z, both of which ARE available and readily downloadable. The components of the hashutils package are: crc32sum.exe md4sum.exe md5sum.exe sha1sum.exe edksum.exe All are available in both x86 and x64 versions (all included in the distribution), all of the utilities support recursive directory traversals with the -r switch, and all work on XP and above. @jaclazdetermined that md5sum.exe was as fast as any other method that was found at the time, and I believe the other utilities should have the same level of performance. Where this came from has been bugging me for over six years, so I figured I would pass this info along since I finally found it again. There are several other useful utilities available on his site, such as elevate, hidecon, vcopy, fontreg, the shell extensions ContextConsole -aka- Open Command Prompt, and HashCheck, among others, so look around and have fun! The two shell extensions mentioned are even open source, with source code available for download. Cheers and Regards
  16. For what its worth, I've been a member at MDL for many years, since 2010, so long I no longer remember if there was a hassle back when I signed up. I just wanted to say that I have NEVER gotten a single email from them for any reason whatsoever. With that experience, I wouldn't worry about getting spammed by them. also, AFAIK, there are many members from here that are also members there, so overall I trust them and their website.
  17. I thought it was just me. Yeah, I'm getting the same behavior that started today. I'm on a Chrome variant. Cheers and Regards
  18. @Snear, you say that those disks "work" on the one "magical" XP system, but don't on the other XP systems or on Win7. When you try them on those other systems, do you move the sharkoon drive bay to those other systems, or do you connect the drives to those other systems in some other manner? Cheers and Regards
  19. Aaahhh! Without the "extra" space, there wouldn't be a "2nd" item for the FOR to find and trip the ERROR part of the code. That is clever! Thanks for the explanation, and the links. Cheers and Regards
  20. Hey guys, sorry it's taken me so long to get back to this and respond. First, @jaclaz I guess I'm not that clever. I even changed the line to... FOR /F "tokens=2 delims=<>:/|?*" %%? IN ("!DlP! ") DO (ECHO ERROR- "%%?" -- "!Dlp!") FOR /F "tokens=2 delims=<>:/|?*" %%? IN ("!DlP!") DO (ECHO ERROR- "%%?" -- "!Dlp!") FOR /F "tokens=2 delims=<>:/|?*" %%? IN (" !DlP! ") DO (ECHO ERROR- "%%?" -- "!Dlp!") FOR /F "tokens=2 delims=<>:/|?*" %%? IN (" !DlP!") DO (ECHO ERROR- "%%?" -- "!Dlp!") FOR /F "tokens=2 delims=<>:/|?*" %%? IN ("!DlP! ") DO (ECHO ERROR- "%%?" -- "!Dlp!") FOR /F "tokens=2 delims=<>:/|?*" %%? IN (" !DlP! ") DO (ECHO ERROR- "%%?" -- "!Dlp!") FOR /F "tokens=2 delims=<>:/|?*" %%? IN (" !DlP!") DO (ECHO ERROR- "%%?" -- "!Dlp!") ...to see if I could see what the "clever" part was. For a "valid" input, it didn't matter, of course, since the FOR "failed", but even with an "invalid" input, such as - c:akjsL:dfh\kasl;dfj\jalsdkj - with an embedded colon, the output was effectively the same: ERROR- "dfh\kasl;dfj\jalsdkj " -- "akjsL:dfh\kasl;dfj\jalsdkj" ERROR- "dfh\kasl;dfj\jalsdkj" -- "akjsL:dfh\kasl;dfj\jalsdkj" ERROR- "dfh\kasl;dfj\jalsdkj " -- "akjsL:dfh\kasl;dfj\jalsdkj" ERROR- "dfh\kasl;dfj\jalsdkj" -- "akjsL:dfh\kasl;dfj\jalsdkj" ERROR- "dfh\kasl;dfj\jalsdkj " -- "akjsL:dfh\kasl;dfj\jalsdkj" ERROR- "dfh\kasl;dfj\jalsdkj " -- "akjsL:dfh\kasl;dfj\jalsdkj" ERROR- "dfh\kasl;dfj\jalsdkj" -- "akjsL:dfh\kasl;dfj\jalsdkj" _Dir="c:akjsL:dfh\kasl;dfj\jalsdkj\" I understand the general operation of the line. Using "tokens=2" with the illegal characters listed as delimiters means that if there are no illegal characters in the input string, then there will be no second item to find, so the FOR will "fail" and the rest of the line will be ignored. Yes, "%%?" picked up the different number of spaces after "!DlP!", but that didn't make any operational difference. So, why have the space? What is the "clever" part? I don't think so. What I mean is that, for example, if you input the string - c":"j"ak"dj"\s"jl"l\"sl"aj"df"hl"k\"ls"aj"kd"\""""""""""""" - your code simply strips out all of the quotes, sees that what is left is valid, encloses it in a singe set of surrounding quotes - "c:jakdj\sjll\slajdfhlk\lsajkd\" - and calls it a day. But if you include one single other illegal character, the string is considered an error. To me, consistency would require either stripping out ALL illegal characters, which is not a trivial task I know, or to consider that any quote marks inside the string, or mismatched quotes outside it, are also considered to be an error. That's what I meant about being consistent. That's just my opinion, and I know that even if you try to deal with all of the complications that you can think of, like you mentioned in your response to (4), you can almost always come up with another improbable situation to trip up a code's execution if you try hard enough. But didn't you say: Regarding the "fun" code I understood some of this, but there definitely were a lot of unexpected things. What I DID understand, sort of, I think: LOL I know that * is a wildcard for 0 or more characters, and ? is a wildcard for 1 character. For the DIR command, I thought that / usually designates an option and the next character says what the option is. And in the subroutine, "%~dp1" expands to the directory and path, ending with a backslash. In the "loop", ? wildcards are added to the "body" one at a time. The output shows "C:\? \", and "C:\?? \", etc, even though "?" is an invalid character for a file or directory, until a directory is found. In my case that is "C:\AMD\", then that is the same output for the rest of the loop. So apparently it is the case of the first directory that is found, no matter how many "?" are used? I don't understand why both "C:\*" and "C:\/" output "C:\", while "C:\*/" outputs "C:\$Recycle.Bin\" for me, which is the first directory, hidden, system, or not. "C:\*a?*/" also outputs "C:\AMD\", which I can see since I think * can match zero characters. "C:\P*/" outputs "C:\pagefile.sys\" for me, which isn't a directory, but it is the first file or directory alphabetically starting with "p". "C:\|/" outputs "C:\|/", which again, is an invalid character. And, another interesting thing is that if you remove the "/" or tail in all of the various tests, then every single one of them output "C:\". So, please enlighten me, wise one. By the way, "Powerhell" is definitely the correct spelling. My efforts with it have been abandoned, though your links were much appreciated. Thanks for the interest and response, @Mcinwwl Windows 7 and PS 2.0. Yes, I discovered that I could update PS, but since I was possibly going to distribute my routine to others using systems with XP and later, I didn't want to require them to also have to update their system, and it wasn't code I wanted to have to provide. I could very easily make a batch routine to call 7-Zip, and call that batch from PS, and I did that, but it just seemed wrong. Maybe hypocritical, since I was perfectly willing to use other external software, but I didn't want to use PS to call batch to call that other software. I either wanted to just use batch, or just use PS. The appeal to me of PS was it's ability to easily modify a file or folder's date and do date comparisons. (I wanted to do this for synchronization purposes, not just changing the date to the current date.) Anyway, I'm using 7z.exe with the following compression commands, given one after the other to the same directory in three passes: 7z.exe a "..\SomeFile.Ext" -ms=off -mx=5 -m0=lzma2 -xr@"7z.Exclude.lst" -xr@"7z.nc.lst" -xr@"7z.PPMd.lst" 7z.exe a "..\SomeFile.Ext" -ms=off -m0=PPMd -ir@"7z.PPMd.lst" 7z.exe a "..\SomeFile.Ext" -ms=off -mx=0 -ir@"7z.nc.lst" ... where "..\SomeFile.Ext" varies and is passed to the routine. I tried everything I could think of, and tried all of the tips I read about, to no avail. Using PS 2.0 I just couldn't get it done. I went back to batch and found a few options that worked to change a file's date. You can use "TOUCH.EXE" from the Windows 2000 Resource Kit, or use NirSoft's BulkFileChanger, which is what I ended up using. The capability to change the date of an individual file is only an option for recent versions of the program, and it's ability to do so via batch programs with variables (vs via its GUI) is not well documented. (You have to create a temporary configuration file with the date and time you want to be used, and the date and time must only be in the form "dd-mm-yyyy hh:mm:ss".) Once I figured all of that out, by trial and error, it worked very well. Thanks for responding, @Yzöwl, I very much appreciate it. I always look forward to reading your batch code, even if it is sometimes written so efficiently it is difficult to do so. I often learn something new from your code. I have never used CertUtil, so the demonstration of its use was good to see. I didn't end up utilizing it, for the following reasons: 1) When possible, I try to write batch code that can run on Windows systems of XP and newer, just for the principle, even though I personally use Windows 7. 2) The external program I am using to create my .md5 file, md5sum.exe, found by me a number of years ago, and separately by jaclaz, and discussed starting here - https://msfn.org/board/topic/162476-looking-for-a-vbs-script-to-generate-md5-of-a-file/page/2/?tab=comments#comment-1034865 - is small, works very well, and it is fast. It is also able to recurse the directory with a simple option switch. I don't remember why I thought I needed to recurse the directory manually. So my entire routine is now reduced to: :f_RecurseMd5 %_DirNames% PUSHD "%~1"&("PathTo\md5sum.exe" -r *.* >App.md5)&POPD GOTO :EOF It's so small, I've folded it into the rest of my routine and it is no longer a subroutine at all. Your routine, as written, is flexible, allowing hashing of an individual file, but you can see that with md5sum, you just need to remove the -r option and list the filename instead of *.* to have the same capability. Both routines output to the standard output, which can be redirected at will. 3) Since the .md5 file was meant to be included with the files that were hashed, I didn't think it was appropriate to have the entire path for each file, but rather only the relative path from inside the folder which is being hashed. The format of such files that I have most often seen is "like" 70a45e89a75d16fccb700a0e368ec541 *7z-x64.msi bed4f5058624589d002afc8d306d1d9b *7z.msi ... etc. Having the hash first, and on the same line, makes the file easier to read, and this format is accepted by programs that I have used that can verify the hashes, such as TeraCopy, among others. I know that your code could be modified to meet this requirement, but by making it bigger, and imperceptibly slower, AFAIK. 4) I really liked the idea of using a capability built into the OS, if the other "issues" could be resolved, but very unlike what I expected, your code was SLOW. I changed your :SUB like so: (having turned ECHO OFF in the main routine, and calling it such that the console window remained open) :SUB FOR /F "EOL=|DELIMS=" %%# IN ('DIR /B%~2/A-D-L-S "%~1"^ ^|"%__APPDIR__%FINDSTR.EXE" /IV "\\App.md5$"')DO FOR /F "DELIMS=" %%$ IN ( '^""%__APPDIR__%CERTUTIL.EXE" -HASHFILE "%~3" MD5 2^>NUL^|FIND /V ":"^"' )DO SET "_=%%$"&CALL ECHO(%%_: =%% *%%~# PUSHD "%~1"&("PathTo\md5sum.exe" -r *.*)&POPD ... with your routine and the addition of md5sum both sending their output to the console to see "real time" how fast they are. It doesn't matter which order the two parts of the subroutine are in, the md5sum.exe part runs NOTICEABLY faster. By visual guess, at least two or three times faster. As an aside, a couple of questions about your code. 1) While I realize that CERTUTIL.EXE, FIND.EXE, FINDSTR.EXE, etc are "external commands", why do you preface them with %__APPDIR__% (yes, I know that's where the external command programs are located) and include the .EXE? Any reason besides just good programming practice? I think this might be the first time I've seen FIND and FINDSTR referred to this way. 2) Any reason you seem to chose to turn off ECHO on the individual lines, instead of just using @ECHO OFF? 3) It might be related, but why the "(" in the @(FOR line? It seems extraneous. I think that addresses all of the responses. Cheers and Regards
  21. @Wunderbar98, Please don't take this a criticism of your choices, but rather as gentle teasing: You insist on using "pure" vanilla Win 98, which we know is strictly your choice and not a requirement. Though as @siria reminds us, you think that Win 98+Linux is OK, and you don't have an issue with using ClassicNick modifications to RetroZilla, which is a modified version of an outdated version of FireFox. So modified versions of Apps are OK. I'm just trying to understand your thought process regarding the definition of "pure", and how that ties in with the definition of consistency. Especially since AFAIK, using things such as KernelX doesn't change the feel, look, hardware requirements, or overall experience of the OS, but merely allows some applications to run that ordinarily wouldn't,. And the same is mostly true with other updates from ME and/or unofficial service packs, etc. In the latter cases, most of the files used are official MS files, just not originally intended for use with Win 98. I'm just curious. It might be interesting, if you are so inclined, once you get your "pure" vanilla Win 98 installation as far as you can reasonably go in the next few weeks (months?), to begin adding in some of these other "improvements" to see if they truly enhance the OS's capabilities without degrading the experience. I think you would be in a perfect position and uniquely qualified to do this. rLowe was another one to have been able to make such a comparison, but he was able to make his own modifications to the OS to meet his needs, far beyond any other method to do so that I am aware of. Those are just random thoughts off the top of my head. Cheers and Regards
  22. Definitely NOT what was expected., and I'm afraid my brain is too foggy for the moment to come up with an explanation. I'll definitely have to think about that for awhile. Care to point me in the right direction, or do I need to suffer for my sins for awhile first? To change the subject a bit, and I'll start a new thread if more appropriate, I've started playing with Powershell. I'm having a devil of a time calling an external program, 7z.exe in this case, from my powershell script, and passing parameters to it and having them interpreted correctly. I know the parameters are correct, since I can call 7z.exe with the same parameters from batch and they are executed just fine, Same if I call a batch routine from powershell which then calls 7z.exe - works just fine. But if I try to call 7z.exe directly from powershell, I get the response "Command line error: Unsupported command:" and then it prints out the exact command I sent, the exact command that has been working for me and others for years, but now it doesn't like it. I tried to simplify the command to a ridiculous extent, even copying directly from the 7z documentation the simplest command I could find, just to see if I could get it to accept ANYTHING as a valid command, but no luck. It is absolutely driving me crazy! Maybe some sleep will help with both problems. Cheers and Regards
  23. Yeah, these kinds of things can be a fun kind of puzzle, and good practice. Minor questions: It's not necessary to check whether the drive letter is a valid character, or can there be a drive "#" or "}"? AFAIK, you can only have 26 drive letters., all alphabetic characters a-z. Isn't there another way to indicate "all remaining characters" other than "254" in - (SET DlP=!%1:~2,254!) -? Or is that not what that is implying? I can't remember off the top of my head. I was assuming you were using a maximum path length of 256 characters. And what if more than 256 characters are entered? I think the limits are supposed to be 260 characters including the drive letter, colon, path including trailing backslash and/or file name with extension, and a terminating null character. Of course the more recent versions of NTFS can handle longer limits, but then Windows Explorer won't be able to deal with them very easily. You'll end up having to rename various folders before you are even able to move or delete files, as I've run into on more than one occasion. Why the trailing space after !DlP! in - ("!DlP! ") - ? If the input string is not in the drive letter, colon, rest of path format, you currently consider it a fatal error. Is this a case of you oversimplifying things? A valid path does not require a leading drive plus colon. It's OK to just throw away any extra quote marks in and around the path, add a missing trailing backslash, and assume the remainder is OK, but if any other illegal characters are found then it's a fatal error? I just try to be consistent. EDIT: And, of course, the code will probably be different if we are testing for an existing location, or just a theoretical, correctly formatted string, to possibly be used at a different location with different resources than the current system has. [ I know, that comment is somewhat argumentative, no offense intended ] I think the testing of the first letter could be done with something "like": SET "Valid=ABCDEFGHIJKLMNOPQRSTUVWXYZ" FOR /L %%G in (0,1,25) DO IF /I "!%1:~0,1!"=="!Valid:~%%G,1!:" (GOTO :keep_testing) ELSE (SET DlP=ERROR&ECHO !Dlp!&GOTO :EOF) For testing an actual location, I suppose this could be adapted: (found here) for /f "tokens=1,2 delims=d" %%A in ("-%~a1") do if "%%B" neq "" ( echo %1 is a folder ) else if "%%A" neq "-" ( echo %1 is a file ) else ( echo %1 does not exist ) Note - This technique is intended to be used for a path without any wildcards (a single specific file or folder). If the provided path includes one or more wildcards, then it provides the result for the first file or folder that the file system encounters. Identical directory structures may give different sort order results depending on the underlying file system (FAT32, NTFS, etc.) Thanks for the fun and feedback. Cheers and Regards
  24. Well, when you put it THAT way... Point taken about ENDLOCAL. The matched quote routine was written to deal with other various variables, and was just reused for this application since it was handy, but your routine is MUCH more efficient when dealing specifically with paths. The errors aren't MY errors, but because of the data dealt with or user input. But like I said at the beginning, I'm sometimes guilty of the belt + suspenders approach to coding. Cheers and Regards
  25. I've written some code in the past where I made extensive use of passing back ERRORLEVEL to indicate which error occurred, and then just got in the habit of always ending my routines that way. I didn't see it as a problem since according to SS64:

  • Create New...