Reputation: 93
Here's the situation, every time I need to do the step below after I boot my computer:
Open the cmd(admin)
copy this cmd into cmd:
C:\Windows\system32\netsh int ipv4 set glob defaultcurhoplimit=65
enter
For now, I hope to double click a file that can directly execute the command above without the step above.
Any method?
Upvotes: 3
Views: 14211
Reputation: 148890
You need a .bat file to execute the command and a shortcut to have it executed as administrator.
Creating the .bat file is trivial: use you favorite text editor (or notepad), type the command, optionnaly add a line PAUSE
if you want to see eventual messages and save it to disk with a .bat extension (say c:\...\sethoplimit.bat)
Creating the shortcut is not much harder: right click on desktop, Create new..., Shortcut, and just select the newly created file
The magic comes now: right click on the newly created shortcut and click Properties, in Shortcut tab, click the Advanced button and select Execute as admin.
That's all. Each time you double click on the shortcut, Windows will start a console with elevated priviledges, eventually open the User Account Control confirmation dialog, and execute the batch file as administrator.
Here I showed you how to create the shortcut directly on the Desktop, but the same process can be used for a shortcut anywhere on a disk folder.
Upvotes: 2
Reputation: 13182
You can save it to .bat or .cmd file and run it on double-click.
.bat
I.g. setLimit.bat
. I assume you know how to create files.C:\Windows\system32\netsh int ipv4 set glob defaultcurhoplimit=65
into the file and press Ctrl+S to safe it. I hope it makes sense otherwise ask.Run as administrator
option in menu.Upvotes: 5