Edit the manpage for a Windows /? command example

How can I edit the manpage for the Windows netsh command.

Since the beginning of wireless networking I've never been able to remember the syntax for the netsh command, and worse, it's always needed when I am off the network so I can't even look it up on my laptop when I need it.

The command to get the name of the Ethernet NIC is easy enough to remember. ipconfig | findstr "Ethernet adaptor"

But then it gets a bit more complicated when you ask for more information. netsh interface ipv4 show config "eth0"

But it's really hard to remember the syntax to set the subnet & gateway. netsh interface ipv4 set address name="eth0" static 192.168.0.2 255.255.255.0 192.168.0.1

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?

Reply to
Michael
Loading thread data ...

Not really, just use notepad to create your own, err, notes.

Reply to
Andy Burns

heeey...what the fuckk u all old shit doing in my emails.

will somethin to everyone will make all of dusappear

Reply to
Fiz 555

If there was a way to edit an executable, Windows Update would only replace it and your notes would be lost :-)

Paul

Reply to
Paul

netsh, as with many tools, gives you only top-level help if you use "<prog> /?". You have to drill down to get to a directive or even sub-directive to add /? to get help on the [sub]-directive, like:

netsh /? netsh interface /? then netsh interface ipv4 /? then netsh interface ipv4 set /? then netsh interface ipv4 set address /?

You could start at the end if you know all the args you want to specify, but I usually have to drill down through the help levels.

There are no man pages in Windows like there is in Linux. Help is built into the program. There is the 'help' command, but that just lists some DOS-mode programs.

Reply to
VanguardLH

I know it's not what you asked, but if you really get in a bind you can probably just use the GUI for doing all of that. No syntax to remember.

Reply to
Char Jackson

take a screen pic and save it

Reply to
Zaidy036

netsh interface portproxy add v4tov4 listenport=xxx listenaddress=192.168.xx.xx connectaddress=192.168.yy.yy connectport=yyy

Because the lanmanserver service starts early and binds to 445 on all interfaces, you may need to install a virtual kernel NIC driver in order to get an interface with a "spare" IP address to listen on, it was available from MS last time I needed it on Win7, not sure about Win10.

Reply to
gtr

It's even better when other people remember your notes for you ;-)

Reply to
Andy Burns

:-> Did you recognize it instantly or did it take a while?

For years since you said that, those are now "my" netsh notes too!

For the benefit of the lurkers, those are Andy's exact words from a few years ago, where I had copypasted them into _my_ netsh notes.

netsh interface portproxy add v4tov4 listenport=xxx listenaddress=192.168.xx.xx connectaddress=192.168.yy.yy connectport=yyy

The topic at the time was a workaround to allow Windows SMB servers to communicate with Android SMB client where there is a port mismatch.

A catch22 arose that the Windows SMB server required specific ports (I think 445 but the actual port isn't the problem - the fact that the port is below 1024 is the problem). Windows is incapable of using any other port.

Then you have non-rooted Android, which is incapable of allowing an app to use any port below 1024.

Andy's netsh notes were to make Windows SMB "think" port 445 was a port higher than 445, for example, 1445, although I never got it to work.

If it ever did work, it would be a great bonus for Windows and Android users because then the non-rooted Android SMB client could work on port

1445 while the Windows SMB server would think port 1445 is port 445.

Did you ever get the syntax down perfectly? I never got it to work.

Reply to
gtr

I tried that, using a logical sequence, and also got stuck at a different point of the tree but it didn't seem that it would ever work logically.

netsh /? ... interface - Changes to the 'netsh interface' context ...

netsh interface /? ... ipv4 - Changes to the 'netsh interface ipv4' context.

netsh interface ipv4 /? ... set interface - Sets interface parameters. ...

netsh interface ipv4 set interface /? set interface [interface=]<string> [[forwarding=]enabled|disabled] [[advertise=]enabled|disabled] [[mtu=]<integer>] [[siteprefixlength=]<integer>] [[nud=]enabled|disabled] [[basereachabletime=]<integer>] [[retransmittime=]<integer>] [[dadtransmits=]<integer>] [[routerdiscovery=]enabled|disabled|dhcp] [[managedaddress=]enabled|disabled] [[otherstateful=]enabled|disabled] [[weakhostsend=]enabled|disabled] [[weakhostreceive=]enabled|disabled] [[ignoredefaultroutes=]enabled|disabled] [[advertisedrouterlifetime=]<0-65535>] [[advertisedefaultroute=]enabled|disabled] [[currenthoplimit=]<0-255>] [[store=]active|persistent] [[forcearpndwolpattern=]enabled|disabled] [[enabledirectedmacwolpattern=]enabled|disabled] [[ecncapability=]ecndisabled|ect1|ect0|application] [[rabaseddnsconfig=]enabled|disabled] [[dhcpstaticipcoexistence=]enabled|disabled]

From there I got lost... sorry.

Reply to
Michael

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.

formatting link
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.

formatting link
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.

Reply to
Freethinker

^^^^^^^^^ \___ address (not interface) That would match on the "netsh interface ipv4 set address ..." command you said you were using.

Reply to
VanguardLH

...

In powershell, you can mark the text and copy it, to a text file.

Reply to
Carlos E.R.

Just like in the command prompt. :-)

Reply to
Stan Brown

Not sure if it works now, but in the 90s I edited (with a text editor!) command.com on a friend's computer for a laugh, so the error messages were amusing. I just found the strings of text and changed them, making sure the number of characters was the same.

And of course there's a way to edit an executable, it's a decompiler.

Reply to
Commander Kinsey

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.