Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.internet.wireless    |    Fun with wireless Internet access    |    55,960 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 55,237 of 55,960    |
|    Freethinker to Herbert Kleebauer    |
|    Re: Edit the manpage for a Windows /? co    |
|    18 Mar 23 03:01:56    |
      XPost: alt.comp.os.windows-10, alt.comp.microsoft.windows       From: freethinker@mymail.com              On 17.03.23 09:46, Herbert Kleebauer wrote:       > On 16.03.2023 16:28, Michael wrote:       >       >> Worse, "/?" help doesn't really help (try it & let me know if it does).       >> So is there a way for me to ADD that example into the "netsh /?" results?       >       > Create you own help file for things you want to know       > but always forget. For example, create a batch file       > with the name "helpme.bat" in a director which is in       > your %path% with a content like this:       >       > @echo off       > set topic=netsh dir copy       > set topic=%topic% move type       > set topic=%topic% mkdir       > echo.       >       > for %%i in (%topic%) do if [%%i]==[%1] goto :%%i       >       > echo help is available for:       > echo %topic%       > echo.       > goto :eof       >       >:netsh       > echo netsh interface ipv4 set address name="eth0" static 192.168.0.2       255.255.255.0 192.168.0.1       > echo.       > goto :eof       >       > :dir       > echo anything       > echo you want to       > echo know about       > echo dir       > echo.       > goto :eof       >       >:copy       > echo anything       > echo you want to       > echo know about       > echo copy       > echo.       > goto :eof       >       >:move       > echo anything       > echo you want to       > echo know about       > echo move       > echo.       > goto :eof       >       >:type       > echo anything       > echo you want to       > echo know about       > echo type       > echo.       > goto :eof       >       >:mkdir       > echo anything       > echo you want to       > echo know about       > echo mkdir       > echo.       > goto :eof              On 17.03.23 09:46, Herbert Kleebauer wrote:       >> Worse, "/?" help doesn't really help (try it & let me know if it does).       >> So is there a way for me to ADD that example into the "netsh /?" results?       >       > Create you own help file for things you want to know       > but always forget. For example, create a batch file       > with the name "helpme.bat" in a director which is in       > your %path% with a content like this:              I don't know about the op but I, for one, _love_ this workaround!              Thank you for this elegant idea which will last me for years       and many computers because it's so elegant and easy to maintain.              I called your code manpage.bat because I've learned the names       have to be easily remembered, and coming from Linux, that's       the first thing that comes to mind as the proper name for it.              You want all the added commands to be easily remembered even       if you don't use them in a year or two or five or ten.              In a command window at the location of the batch file, I typed:        manpage       Which said:        help is available for:        netsh dir copy move type mkdir       I typed:        manpage netsh       It reported:        netsh interface ipv4 set address name="eth0" static 192.168.0.2 255.255.255.0       192.168.0.1       I typed:        manpage dir       It reported:        anything        you want to        know about        dir       I typed:        manpage foo       It reported:        help is available for:        netsh dir copy move type mkdir              I don't like sticking things into my $PATH so I added it to the AppPaths.        HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\manpage.exe        @default=c:\path\manpage.bat       So that "Win+R" & then "manpage" would get the results over the years.       https://learn.microsoft.com/en-us/windows/win32/shell/app-registration              But it only flashed when I did that, even when I linked to a shortcut:        @default=c:\path\manpage.lnk              Googling said to add "explorer.exe" to the beginning of that shortcut       target to keep the command window but that also just flashed at me.        manpage.lnk        target=explorer.exe /k c:\path\manpage.bat              Then I prepended "%comspec% /k" to the shortcut target & that worked.        target=%comspec% /k c:\path\manpage.bat              That worked wonderfully to open up a command window with the initial       list of available commands already waiting for me (as it runs it first).              The command windows is already at the right path so there's no need       to pollute the $PATH with yet another needless entry (enough already).              That's the whole purpose of the Windows AppPaths registry sub key.       https://helgeklein.com/blog/how-the-app-paths-registry-key-makes       windows-both-faster-and-safer/              This is probably what I'll use for the next decade or two because       it's simple and obvious and elegant enough to be easily remembered       and when needed, it's eminently extensible as it's self explanatory.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca