Discussion:
Please follow this cut-and-paste tutorial to get batch command shortcuts working perfectly on Windows
Add Reply
Arlen Holder
2018-06-08 02:04:43 UTC
Reply
Permalink
Raw Message
****************************************************************************
Cut-and-paste just-follow-my-footsteps tutorial for creating batch file
shortcut which work well in Windows 7 & 10 in your personalized menus
****************************************************************************
This tutorial assumes these basics that everyone should be able to do:
NOTE: All personalized paths below are examples (use your own paths).
- We want a shortcut to a batch file which accepts user input.
- Clicking the shortcut should pop up the program asking for user input.
- We want the shortcut to have a distinctive small icon (for menus & bars).
- We want the shortcut in the left-side start menu (alphabetical list).
- We want the shortcut in the orthogonal start menu (tiled start menu).
- We want the shortcut in a personal cascade menu (on the task bar).
- We want the shortcut in the task bar.
- We want to be able to run the command at both Cortana & the "Run" box.
- We don't want to have to click Yes to UAC permission queries.

Here are the two batch files we will set up for Windows shortcuts:
- curlme.bat (check your current WLAN IP address & ping speeds)
- killgw.bat (kill the gateway to protect from VPN dropouts).
Note: curlme is shorter & doesn't ask for UAC permission, so it's easier.
----------------------------------------------------------------------------
1. Create & test the batch file above (or any batch file requiring input).
C:\app\os\bin_shell\curlme.bat
@echo off
set pingit=www.google.com
:curlme
C:\app\network\curl\bin\curl.exe icanhazip.com
timeout 1 /nobreak>nul
ping %pingit%
pause
goto curlme
:stop
exit
----------------------------------------------------------------------------
2. Set Windows to eliminate additional default text onto shortcut names:
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates
Create this variable and value.
ShortcutNameTemplate = "%s.lnk"
----------------------------------------------------------------------------
3. Create & test a desktop shortcut to that batch file.
curlme.bat.lnk
Target = C:\app\os\bin_shell\curlme.bat
StartIn = C:\app\os\bin_shell
----------------------------------------------------------------------------
4. Change the icon for that batch file shortcut.
Right click on the shortcut > Properties > [Change Icon...]
Note: If you run this step out of sequence, you won't have the
same selection of icons, but you can always manually enter:
Look for icons in this file = %SystemRoot%\System32\SHELL32.dll
----------------------------------------------------------------------------
5. Notice that you can't right click to "Pin to Start".
Nor can you right click to "Pin to taskbar".
Also notice you can't just drag the shortcut into the taskbar.
But at least you can copy the shortcut to your personal cascade menu:
C:\ProgramData\Microsoft\Windows\Start Menu\menu\os\bat_shell\curlme.lnk
----------------------------------------------------------------------------
6. You might think to put the shortcut in either of these folders:
%appdata%\Microsoft\Windows\Start Menu\Programs\ <-- for just the user
%programdata%\Microsoft\Windows\Start Menu\Programs\ <-- for all users
Then it will show up in the left-side Start Menu.
And from there, you can right click on the list to "Pin to Start"
which will copy it as a tile to the orthodox side of the Start Menu.
But you still won't be able to copy the shortcut to the task bar.
----------------------------------------------------------------------------
7. Notice that you can't right-click and Pin to taskbar this shortcut yet.
Right click on the shortcuts and change the Target line from:
From Target = C:\app\os\bin_shell\curlme.bat
To Target = %windir%\system32\cmd.exe /K "C:\app\os\bin_shell\curlme.bat"
And
From Target = C:\app\os\bin_shell\killgw.bat
To Target = %windir%\system32\cmd.exe /K "C:\app\os\bin_shell\killgw.bat"
Now when you right-click on this shortcut, you can "Pin to taskbar".
----------------------------------------------------------------------------
8. Notice that you can run the curlme command from Cortana:
Cortana > curlme > Enter
But you can't run it yet in the "Run" box.
(Right-click on Start) > Run > curlme > Enter
Which outputsthe error: Windows cannot find 'curlme'.
----------------------------------------------------------------------------
9. Notice that you can't yet run curlme from the Windows "Run" box.
Rightclick Start > Run > curlme <=== this fails
Navigate to the "App Paths" registry location:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
Right click on "App Paths" > New > Key
Name the key "curlme.exe" <=== it must end with ".exe" to work!
Set the default value = C:\app\os\bin_shell\curlme.bat
Now you can run curlme from the Windows "Run" box.
Rightclick Start > Run > curlme <=== this works
----------------------------------------------------------------------------
10. Optionally tell the "Run" box to remember your previous commands.
Start > Settings > Personalization > Start > Show most used apps = On
----------------------------------------------------------------------------
11. Once you have curlme working, it's time to deal with UAC permissions.
Obtain the kill-gateway batch file which requires UAC permissions.
<https://www.liquidvpn.com/billing/dl.php?type=d&id=49>
For convenience, rename the batch file:
FROM: LiquidVPN-Kill-Switch.bat
TO: killgw.bat
And put the file in your batch-command directory:
C:\app\os\bin_shell\killgw.bat
Note: The killgw.bat file requires administrator priveleges
so we will have one extra step to selectively disable UAC for killgw.
----------------------------------------------------------------------------
12. Run steps 1 through 10 above on this new batch file.
Then, if you can figure out how to get the UAC prompt to go away
without loading 3rd-party software & without turning UAC off totally,
let all of us know - because I can't figure that out yet.
- Scheduled tasks isn't going to work for this command.
- Microsoft Application Compatibility Toolkit might work.
- Third-party solutions almost always come at a compatibility cost.
----------------------------------------------------------------------------
--
I only ask you to run this tutorial, and tell us what didn't work, and,
then for all of us to try to figure out a good solution to step #12.
R.Wieser
2018-06-08 09:56:23 UTC
Reply
Permalink
Raw Message
Arlen,
Post by Arlen Holder
which work well in Windows 7 & 10
And why than did you post it in an XP oriented newsgroup ? <whistle>
Post by Arlen Holder
C:\app\network\curl\bin\curl.exe icanhazip.com
Neither that program nor that folder exists on my XPsp3 installation. And
I could well imagine that it doesn't exist on standard installations of 7
and 10 either.

In other words: When posting a handy batch file, make sure you either only
use programs that are available on a default install (in this case, for all
three of the OS versions), or mention the used programs as prerequisites for
it.
Post by Arlen Holder
I only ask you to run this tutorial, and tell us what didn't work,
See above. :-)

Regards,
Rudy Wieser
Mayayana
2018-06-08 13:16:12 UTC
Reply
Permalink
Raw Message
"R.Wieser" <***@not.available> wrote

| And why than did you post it in an XP oriented newsgroup ? <whistle>
|

Win7 was also not relevant. Nor is the general post.
This seems to be the same character who posts as
"Ragnusen Ultred" and various other aliases. His posts
are recognizable by the imperious, officious tone,
extreme complexity, and a striking solicitousness
aimed at keeping people engaged.
Arlen Holder
2018-06-08 14:11:26 UTC
Reply
Permalink
Raw Message
Post by Mayayana
Win7 was also not relevant. Nor is the general post.
This seems to be the same character who posts as
"Ragnusen Ultred" and various other aliases.
C'mon Mayayana,

Stop being a jerk just because your use model is different than mine.
And stop claiming to be a genius for claiming to figure out what's not
hidden.
And start THINKING for once, to try to ADD VALUE for heaven's sake.

We're wasting everyone's time by you being a jerk again, and by you not
caring about a poster's privacy (and by your troll's intent being to
declare that you're a genius for figuring out the obvious - when I even use
custom paths that you *know* are mine since nobody else uses them - so your
intention of posting was to claim you're an utter genius for figuring out
the obvious that was never hidden).

Everything you posted in your troll above, was a waste of our time.

The worst waste is that I have to respond to your continued childish
drivel, time after time after time, about you not liking that someone else
has perfectly valid use model that happens to be different from yours. We
already discussed your imbued racism in that regard, many times.

A. You use a chitchat model; I use a FAQ model.
B. In the chitchat model, who you are is more important than the value you
add in each post (which is almost zero added value in each post).
C. In the FAQ model, what VALUE YOU ADD is more important than who you are
(where who you are isn't important).

Having to explain that to you for the umpteenth time just wastes everyone's
time and energy.

Our time and energy is better spent helping each other IMPROVE our skills.
a. The tutorial contains very useful information for all Windows users.
b. For example, the curl idea is extremely useful to anyone on Windows.
c. I improve the tutorial based on comments from users who test it out.

I write THOUSANDS of tutorials, all of which are cut and paste, and all of
which contain useful ideas that you won't find elsewhere, at least not in a
single spot. I've been writing these tutorials for decades.

The tutorial helps users do a LOT of things that most people may not even
know how to do, such as how to figure out your WLAN IP address without
using a web browser to http://whatismyipaddress.com which has browser
security issues such as browser fingerprinting.

For privacy, for example, curl is better because it can be run only when
you're on VPN, for heaven's sake. That privacy tip alone is valuable since
most people use Whatismyipaddress which is inherently less secure.

Similarly, changing the icon for a batch file isn't intuitive on all
Windows platforms once you add the cmd option. And the killgw batch file
also provides valuable privacy to the user, on any Windows platform.

Luckily, the whole thing runs on Windows XP far easier than it does on
Windows 7 and it runs on Windows 7 easier than it runs on Windows 10, so I
probabably should put a bunch of "goto" statements in the tuturial to show
how it works on Windows XP in far fewer steps, and in Windows 7 in fewer
steps.
Post by Mayayana
His posts
are recognizable by the imperious, officious tone,
extreme complexity, and a striking solicitousness
aimed at keeping people engaged.
For the umpteenth time, you keep thinking that everyone uses your chitchat
model, which just isn't a fact.

I don't care how long a thread is. It's worthless if each post doesn't add
value. Even *this* post doesn't add any value except to tell you, for the
umpteenth time, that you have a closed mind that can't accept the fact that
some people
a. Value their privacy from aggregators, and,
b. Post valuable information outside your chitchat model of constant
drivel.

NOTE: I will NOT reply further to you in this thread, since this post
responding to your post - make both of them a complete waste of everyone's
time.

Let's get back to IMPROVING OUR SKILLS which is what the tutorial is all
about. On-topic suggested improvements are all that I seek.

I will REMOVE WindowsXP from further responses in this thread.
I will REMOVE Windows7 from further responses in this thread.
I will CONTINUE to improve the skills of all Windows users.
And I will continue to SOLICIT users to test out the tutorials I write.

That's because I'm a good Usenet citizen, and I have been doing this for
decades, with thousands of helpful tutorials to my credit, if not to my
name.
--
This was hastily written so it's not well organized like the tutorial was,
which took me about five hours to write and test so that others would be
able to follow easily.
R.Wieser
2018-06-08 20:55:09 UTC
Reply
Permalink
Raw Message
Arlen,
... to figure out what's not hidden.
If it (your identity) is not hidden by your nym changing, why do you bother
doing it ?
And stop claiming to be a genius for claiming
I'm sorry, but where did he claim that ?
And start THINKING for once, to try to ADD VALUE for
heaven's sake.
You must have been looking into a mirror when you came up with that line.
:-D

Lets face it: You have posted a twelve-step ... something which has zero
usefull description - and no, "tutorial for creating batch file shortcut"
doesn't cover it in the slightest.

You also make it appear it works for windows versions you *obviously* have
not tested it for, looking at all kinds of W10 only references (without any
mentioning of that fact) and including at least one command that does not
exist on XP (and no, I'm not talking about curl.exe here).

Furthermore, the process of creating a shortcut to a batchfile is, under XP,
as easy as rightclick drag-and-dropping, and than selecting "create shortcut
here" from the popped-up context menu. I imagine it would work the same
for W7 and W10.

Also, do not mix two rather different things together in a single tut.
Explaining how, on W10, shortcuts can be placed in special (W10 only) places
is one thing. Some batch script to be able to easily see what your
external IP is and how slow/fast the connection to a known server is is
something quite different. Keep them apart.

Also, those "we want" lines at the top of that list ? They sound pompous
and presumptious. :-(

In my case I can say that I certainly do *not* want to have such a shortcut
to pop up in all those places all over my machine. I would probably just
put it in a folder where the other related stuff is stored, and if I really
*really* need it more often I would probably place it in my "tools"
subfolder attached to the start menu.


Suggestion: If you want to "add value", than try to think from a users
perspective - and remember that there are quite a number of different POVs
out there. So, make *suggestions* to what is possible (maybe with some
"best practices" indications thrown in here-and-there), but leave it up to
the user to decide what he wants.

And a last suggestion: do *not* (try to) attack the messenger (in this case
Mayayana). The only thing that that will result in is strengthening the
appearance of validity of the message that was presented (I have to go and
actually read it now - quite the Streisand effect I would say). If you want
to be taken seriously than "attack" the message itself (bring up proof and
by it reason to why its statements and/or conclusions are incorrect).

Regards,
Rudy Wieser

P.s.
I've been using the above name - my own - as long as I have access to usenet
groups. Which is at least 2 decades. And yes, even though I value my
privacy too.
nospam
2018-06-08 14:39:10 UTC
Reply
Permalink
Raw Message
Post by Mayayana
| And why than did you post it in an XP oriented newsgroup ? <whistle>
Win7 was also not relevant. Nor is the general post.
This seems to be the same character who posts as
"Ragnusen Ultred" and various other aliases. His posts
are recognizable by the imperious, officious tone,
extreme complexity, and a striking solicitousness
aimed at keeping people engaged.
a good summary of his tactics.
Diesel
2018-06-09 03:59:46 UTC
Reply
Permalink
Raw Message
Post by Mayayana
| And why than did you post it in an XP oriented newsgroup ? <whistle>
|
Win7 was also not relevant. Nor is the general post.
This seems to be the same character who posts as
"Ragnusen Ultred" and various other aliases. His posts
are recognizable by the imperious, officious tone,
extreme complexity, and a striking solicitousness
aimed at keeping people engaged.
A decent summary of their operating tactics.
--
To prevent yourself from being a victim of cyber
stalking, it's highly recommended you visit here:
https://tekrider.net/pages/david-brooks-stalker.php
===================================================
It's later than you think.
Arlen Holder
2018-06-08 13:31:27 UTC
Reply
Permalink
Raw Message
Post by R.Wieser
Post by Arlen Holder
C:\app\network\curl\bin\curl.exe icanhazip.com
Neither that program nor that folder exists on my XPsp3 installation. And
I could well imagine that it doesn't exist on standard installations of 7
and 10 either.
In other words: When posting a handy batch file, make sure you either only
use programs that are available on a default install (in this case, for all
three of the OS versions), or mention the used programs as prerequisites for
it.
Thanks for catching that omission of mine!
Now I can improve the tutorial!

To my credit, I had posted where to get the kill-gatwway batch file, but to
my discredit, I had forgotten that curl isn't part of the system.

Based on your input, I will improve the tutorial so that it contains the
location of curl, although I'm not quite sure if there is only one
canonical location for curl for Windows.

Where, basically, the (canonical?) location for curl see,s to be here:
https://curl.haxx.se/download.html

Or, maybe it's here?
http://www.confusedbycode.com/curl/

So, I agree, it's a little confusing to pick the "one" canonical location
for curl, simply because they have a score of Windows flavors:
https://curl.haxx.se/download.html

DOS - zip - 7.10.5 binary Doug Kaufman
DOS - 7zip - 7.53.0 binary Michael Kostylev
Win32 - 7.57.0 binary Chocolatey
Win32 - Generic - 7zip 7.53.1 binary Darren Owen
Win32 - Generic - zip 7.59.0 binary Marc Horsken
Win32 - Generic - zip 7.60.0 binary Dirk Paehl
Win32 - Generic - CAB 7.60.0 binary Stefan Kanthak
Win32 - Generic - zip 7.60.0 binary Dirk Paehl
Win32 - Generic - zip 7.60.0 binary Viktor Szakats
Win32 - cygwin - binary - 7.59.0 Cygwin
Win32 - cygwin - 7.59.0 libcurl Cygwin
Win64 - binary - 7.57.0 Chocolatey
Win64 - Generic - ia64 CAB 7.60.0 binary Stefan Kanthak
Win64 - Generic - x86_64 7zip 7.53.1 binary Darren Owen
Win64 - Generic - x86_64 zip 7.59.0 binary Marc Horsken
Win64 - Generic - x86_64 CAB 7.60.0 binary Stefan Kanthak
Win64 - Generic - x86_64 zip 7.60.0 binary Viktor Szakats
Win64 - cygwin - 7.59.0 binary Cygwin
Win64 - cygwin - 7.59.0 libcurl Cygwin

Luckily, there's an installation guide I can link to:
http://support.gnip.com/articles/curl-on-win7.html

In summary, you're right that I forgot to provide the download location for
"curl", so I thank you for bringing that up. The problem will be to figure
out which is the ONE location to point them to.

I'm leaning toward this wizard - how does that sound?
https://curl.haxx.se/dlwiz/
Loading...