Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What syntax combines 2 commands into a single shortcut TARGET line?

30 views
Skip to first unread message

AG Holder

unread,
Aug 28, 2019, 9:25:07 PM8/28/19
to
What syntax combines 2 commands inside a single Windows shortcut TARGET?

While this single shortcut TARGET line unmounts ALL mounted file containers
VeraCrypt.exe /dismount /force

This shortcut TARGET works fine to mount the Q.hc file container:
VeraCrypt.exe /volume C:\Q.hc /letter Q /auto /quit /explore /beep

This shortcut TARGET mounts the V.hc encrypted file container:
VeraCrypt.exe /volume C:\V.hc /letter V /auto /quit /explore /beep

But how do you string those two commands into the same shortcut TARGET?

Combining them with "&" and "&&" in a single shortcut TARGET line garners:
"VeraCrypt: Error while parsing command line."

What syntax combines 2 commands into a single shortcut TARGET line?

Grant Taylor

unread,
Aug 28, 2019, 10:17:19 PM8/28/19
to
On 8/28/19 7:25 PM, AG Holder wrote:
> What syntax combines 2 commands inside a single Windows shortcut TARGET?

I'm not aware of any single command syntax that can do that.

Put the multiple commands in a batch (or command) file and make it the
target of the shortcut.



--
Grant. . . .
unix || die

R.Wieser

unread,
Aug 29, 2019, 3:08:44 AM8/29/19
to
Oh. My. God.

Again one of those "lets just shit all over the newsgroups" posts of our
resident brainiac.

Kudos to you kid, you are to dumb to even realize that MSDOS doesn't have
anything resembling shortcuts. Let alone that "veracrypt" isn't available
for DOS. In short: No help to be expected from MSDOS users, batch or
otherwise.

Besides: How hard is it to realize that you can, as Grant already indicated,
use the link to start a batch file (or any other kind of script! PowerShell
perhaps ?) to do some multi-line commands (or maybe even create a (batch
style, single-line!) loop over the involved drive letters).

> Combining them with "&" and "&&" in a single shortcut
> TARGET line garners: "VeraCrypt: Error while parsing
> command line."

Little wonder brainiac, as stitching commands together using "&" or "&&" is
only valid on the commandline and has no meaning in the rest of Windows.
Didn't you know ?

But if you really /have/ to do it that way just shortcut to CMD.EXE and have
it execute that commandline. Problem solved.

Regards,
Rudy Wieser

P.s.
removed: alt.comp.freeware. Reason: Too many xpost groups


AG Holder

unread,
Aug 29, 2019, 11:50:28 AM8/29/19
to
On Wed, 28 Aug 2019 20:17:01 -0600, Grant Taylor wrote:

> I'm not aware of any single command syntax that can do that.

Hi Grant Taylor,

Usenet is a potluck where everyone brings what value they can to share.

Hence, I thank for that information, as there is usually a trick that an
expert knows for almost any efficiency maneuver (such as the trick to use
"control + shift" along with "enter" in a run command to be administrator).
a. Usually there's a syntax available in the command interpreter
b. Often there's a command available in the program (i.e., Veracrypt)
c. Sometimes another command can be substituted (e.g.,

For example, combining commands works fine in the DOS shell, e.g.,
o C:\ cmd1 & cmd2 (execute them in sequence)
o C:\ cmd1 && cmd2 (execute after evaluating errorlevel 0,1)
o C:\ cmd1 | cmd2 (redirect the first into the second)
o C:\ cmd1 || cmd2 (redirect only after evaluating errorlevel 1,0)
o C:\ cmd1 >> foo.txt 2>&1 (make use of the stdout error file)

But they don't seem to work inside the TARGET line of a shortcut.
But there must be a way to add multiple commands to a single TARGET line.

Almost always, what people "think" doesn't exist (e.g., WinXP menus on
Win10) are already there - native - (e.g., the curl command is in Windows
10 and almost nobody knows about it).

There's ALWAYS a way to do anything we want to do in a batch file, e.g.,
how we added the red color to just our Windows Admin command prompts:
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/ySVGbayhLSk/khw_ulyZBAAJ>

Or like how we created a "grep" of our phone rolodex files
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/ySVGbayhLSk/N-IqUQPiAwAJ>

But the goal here is clearly to put the efficiency commands into a single
line of a shortcut TARGET, and that's it, where we can use some sort of
Windows expert knowledge, such as how we utilized the AppPaths key to
create an efficient "vipw" command without editing anything but the
registry.
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/ySVGbayhLSk/8EMXRgb5AwAJ>

The point is that, almost always, Windows experts can find Windows tricks
(such as the AppPaths command) that make almost ANY command possible with
efficiency (sans mucking with the path) - as we found with the AppPaths key
for "hosts" which opens the extensionless hosts file in a single cmd into
your default editor.

As you seem to be astutely aware (unlike the troll, Rudy Wieser who has
never posted anything above his fifth-grade education level in his entire
life) this is a similar Windows-expert efficiency question, where the
always sophomoric response by Rudy of pointing to a batch file was NEVER
the goal (which you intelligently ascertained immediately).

Still ... there must be a way - as there is _always_ a way to efficiency.

I will continue to seek the desired efficiency, where I explored these
o TARGET = cmd1 & cmd2 (execute them in sequence)
o TARGET = cmd1 && cmd2 (execute after evaluating errorlevel 0,1)
o TARGET = cmd1 | cmd2 (redirect the first into the second)
o TARGET = cmd1 || cmd2 (redirect only after evaluating errorlevel 1,0)
o TARGET = cmd1 >> foo.txt 2>&1 (make use of the stdout error file)
etc.

But I still have more ideas to test out before we give up (which we almost
never have to do, since we can almost always find an efficientway to do
everything that we do frequently - without having to resort to the crutch
of batch files.

Wildman

unread,
Aug 29, 2019, 11:57:54 AM8/29/19
to
All these facts will only serve to confuse Arlen.
Shame on you.

--
<Wildman> GNU/Linux user #557453
I am Fudd of Borg. Wesistance is usewess.

Mayayana

unread,
Aug 29, 2019, 12:22:57 PM8/29/19
to
"R.Wieser" <add...@not.available> wrote

| Oh. My. God.
|
| Again one of those "lets just shit all over the newsgroups" posts of our
| resident brainiac.
|

No point getting upset. No point trying to shame him
or give him a rational answer. He only posts to hear
himself talk. All you can do is add his latest pseudonym
to your blocked senders list.



AG Holder

unread,
Aug 29, 2019, 12:24:14 PM8/29/19
to
On Thu, 29 Aug 2019 15:50:27 -0000 (UTC), AG Holder wrote:

> I will continue to seek the desired efficiency, where I explored these
> o TARGET = cmd1 & cmd2 (execute them in sequence)

Hi Grant Taylor,

SOLVED!

Once I followed your helpful suggestion to give up on wasting time trying
to get the the ampersand syntax to work with the app directly in the TARGET
line, I then immediately figured out a way to incorporate the ampersand
into the TARGET line anyway, which was to utilize the same technique we
used in the past to combine commands to create a rolodex grep using nothing
more than a simple call to a registry key.

This is the simple solution (so far):
o Calling the application directly doesn't allow the ampersand to work
o But calling the app via the comspec _does_ allow the ampersand to work

That is, this doesn't work:
o TARGET = cmd1 & cmd2
But this does work!
o TARGET = %compspec% /k cmd1 & cmd2

I should have remembered this, but my memory was tweaked by my last
response, where we've solved so many Windows problems that we forget all
the tricks - where the trick was that I had already used (long ago) this
comspec /k concept to create a shortcut which spits out system snapshot
information into a file, where, from memory, the TARGET line was something
like the following that I just hacked out for this post:

TARGET = %comspec% /k date /T > sys.txt & ipconfig /all >> sys.txt & route
print >> sys.txt & netsh int ip show route >> sys.txt & systeminfo >>
sys.txt & net start >> sys.txt & dir /s/a/l/on/b C:\ *.* >> sys.txt

That same technique, which I had forgotten we used long ago to create
system snapshots, worked fine with Veracrypt just now:

TARGET = %comspec% /k veracrypt.exe [PUT THE FIRST MOUNT HERE] & [PUT THE SECOND MOUNT HERE]

Now we have efficient shortcuts which mount & dismount ALL encrypted
volumes in a single TARGET line.

TARGET = veracrypt.exe /dismount /force
TARGET = %comspec% /k veracrypt.exe /volume C:\tmp\X.hc /letter X /auto /quit /explore & veracrypt.exe /volume C:\tmp\Y.hc /letter Y /auto /quit /explore

In summary, the simple trick was to NOT use the application commands
directly in the shortcut TARGET, but to use the /k comspec switch first,
and _then_ combine the two application commands.

This concept of adding the ampersand to the shortcut TARGET line, of
course, will have general use in the future, so it's great that we were
able to add value to the Usenet potluck to share with the other team
members who care to learn how to be extremely efficient on Windows.

B. R. 'BeAr' Ederson

unread,
Aug 29, 2019, 1:04:45 PM8/29/19
to
On Thu, 29 Aug 2019 01:25:06 -0000 (UTC), AG Holder wrote:

> What syntax combines 2 commands inside a single Windows shortcut TARGET?

None. A shortcut isn't a shell, but a defined structure to information
resolvable as a command string to a *single program* with parameters:

[NAME_STRING] [RELATIVE_PATH] [WORKING_DIR] [COMMAND_LINE_ARGUMENTS] [ICON_LOCATION]

or to a *single document*, which hopefully has a standard action/program
assigned to its file type.

Here's the current file format reference:

https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SHLLINK/[MS-SHLLINK].pdf

As long as you do not wish to link to script files, which of course could
execute several commands, your only other option would be to link to a
launcher program, that is able to execute several commands listed as its
command line arguments.

You can use the cmd shell as such a launcher, e.g.:

cmd.exe /c notepad C:\Temp\1.txt && notepad C:\Temp\2.txt
cmd.exe /c notepad C:\Temp\1.txt & notepad C:\Temp\2.txt
cmd.exe /c start notepad C:\Temp\1.txt & notepad C:\Temp\2.txt

The first version starts the second command only if the first command
succeeded successfully. The second version starts the second command
when the first completed (successful or not). The third version starts
the second command directly after starting the first (while the first
is still running).

BeAr
--
===========================================================================
= What do you mean with: "Perfection is always an illusion"? =
===============================================================--(Oops!)===

AG Holder

unread,
Aug 29, 2019, 2:18:19 PM8/29/19
to
On Thu, 29 Aug 2019 19:04:39 +0200, B. R. 'BeAr' Ederson wrote:

> None. A shortcut isn't a shell, but a defined structure to information
> resolvable as a command string to a *single program* with parameters:

Hi Bear,

We go way back, over the years, where you're always purposefully helpful.

Hence thanks for your purposefully helpful added value to the Potluck.
o Linking to a launcher is EXACTLY what we did to SOLVE the stated problem.

Bear in mind, it's extremely useful, particularly for encrypted file
containers, to be able to mount and unmount ALL of them, instantly.

> As long as you do not wish to link to script files, which of course could
> execute several commands, your only other option would be to link to a
> launcher program, that is able to execute several commands listed as its
> command line arguments.

The goal, always, is efficiency & part of efficiency is portability, where
NOT having to create, maintain, and port batch files is useful.

Also, having a shortcut on the taskbar that doesn't require anything else
to run, or having a Start > Run command in the registry that also doesn't
require anything else to run - is useful - particularly given the goal is
efficiently quick mounting and dismounting of ALL encrypted file containers
in a single operation.

> You can use the cmd shell as such a launcher, e.g.:
>
> cmd.exe /c notepad C:\Temp\1.txt && notepad C:\Temp\2.txt
> cmd.exe /c notepad C:\Temp\1.txt & notepad C:\Temp\2.txt
> cmd.exe /c start notepad C:\Temp\1.txt & notepad C:\Temp\2.txt
>
> The first version starts the second command only if the first command
> succeeded successfully. The second version starts the second command
> when the first completed (successful or not). The third version starts
> the second command directly after starting the first (while the first
> is still running).

Yup. Thanks for your purposefully helpful on-topic suggestion, which is the
only one known to man that fits the stated problem set (AFAIK).

I figured what you already knew out after Grant kindly told me to stop
wasting time trying to get the ampersand syntax to work in the TARGET all
by itself.

Then, when I looked up the old "grep" rolodex command tutorial we created,
and when I then saw the old "open the admin command window with big fonts &
a red background" tutorials from years ago that we wrote, I instantly
remembered and realized we used the compec with an added switch whenever we
found that we couldn't nest commands in the Windows shortcut TARGET line:

That is, this failed in the shortcut TARGET line:
o cmd1 & cmd2

This worked in the shortcut TARGET line:
o %comspec% /k cmd1 & cmd2
o %comspec% /c cmd1 & cmd2

Where the commands could have been anything, e.g.,
o TARGET = %comspec% /k date /T > sys.txt & ipconfig /all >> sys.txt & route print >> sys.txt & netsh int ip show route >> sys.txt & systeminfo >> sys.txt & net start >> sys.txt & dir /s/a/l/on/b C:\ *.* >> sys.txt

But where, in this situation of mounting encrypted file containers, it was:
o TARGET = %comspec% /k VeraCrypt /volume X.hc /letter X /auto /quit /explore & VeraCrypt /volume Y.hc /letter Y /auto /quit /explore

NOTE: The Truecrypt "beep" switch doesn't seem to work with Veracrypt.
%comspec% /k Truecrypt /volume X.tc /letter X /auto /quit /explore /beep & Truecrypt /volume Y.tc /letter Y /auto /quit /explore /beep

NOTE: The Veracrypt applications has switches to unmount all containers:
o TARGET = VeraCrypt /dismount /force

In summary, this problem set has been SOLVED - thanks to you & Grant.

Over the years, we've all grown to know who brings purposefully helpful
added value to the Usenet potluck, where I appreciate your post, and that
from Grant Taylor, both of which were adult purposefully helpful posts
which brought value to share with the interested Windows community, such
that we can now easily mount and dismount all the encrypted file containers
with an efficient single TARGET line of nested Veracrypt/Truecrypt
commands.

--
I will not respond further to the worthless child-like trolls Rudy Wieser
and Mayayana, both of whom not only posted dead wrong information, but
neither of whom had any intent of purposefully adding adult value.

AG Holder

unread,
Aug 30, 2019, 4:37:16 PM8/30/19
to
On Fri, 30 Aug 2019 12:19:23 -0500, Guy wrote:

> make favorite volumes
> veracrypt /a favorites

Hi Guy,
Thank you for being purposefully helpful in contributing added value to
share on Usenet for how to mount all "favorite" encrypted file containers
in a single Windows shortcut TARGET line.

RTFM:
o Favorites C:/pathto/veracrypt/docs/html/en/Favorite%20Volumes.html
o System Favorites C:/pathto/veracrypt/docs/html/en/System%20Favorite%20Volumes.html

To set up:
1. First, mount your favorite set of multiple encrypted file containers.
2. Then use "Favorites > Add Mounted Volumes to Favorites" for each volume
3. Fill out the favorites options form, as desired, for each mounted volume

To test:
a. Dismount all volumes using your dismount shortcut TARGET of
TARGET = VeraCrypt.exe /dismount /force
b. Mount the favorite set of volumes using the favorites TARGET of
TARGET = VeraCrypt.exe /a favorites

Summary of shortcut TARGETs:
A. The dismount.lnk shortcut TARGET instantly dismounts all mounted volumes
TARGET = VeraCrypt.exe /dismount /force
B. The favorite.lnk shortcut TARGET mounts s given favorite set of volumes
TARGET = VeraCrypt.exe /a favorites
C. The mount.lnk shortcut TARGET runs any series of commands in Windows:
TARGET = %comspec% /c VeraCrypt.exe /volume P.hc /letter P /auto /quit /explore && {add desired commands as needed}

--
Thanks go to Grant Taylor, Bear Ederson, & Guy for their purposefully
helpful adult on-topic contributions to share on this Usenet newgroup.

Arlen Holder

unread,
Jun 16, 2020, 9:10:28 PM6/16/20
to
UPDATE:

Today we solved the problem of adding modified windows icons
to shortcut files which targeted multiple Windows commands.

Usenet is a wonderful public web-searchable archive of useful tutorials.
o As always, please improve so all benefit from every thread.

o *Tutorial for modifying icons inside common Windows system DLLs*
<https://groups.google.com/forum/#!topic/rec.photo.digital/lAJV8OZdZjg>
o <https://i.postimg.cc/hPTCzbtc/icon08.jpg>
o <https://i.postimg.cc/HnrdTvww/icon07.jpg>
o <https://i.postimg.cc/SNJgdfKB/icon05.jpg>
o <https://i.postimg.cc/NFhjn4cd/icon04.jpg>
o <https://i.postimg.cc/76ZvXJdf/icon03.jpg>
o <https://i.postimg.cc/X7VKMQGM/icon02.jpg>
o <https://i.postimg.cc/43GKMY2Z/icon01.jpg>

o *Tutorial for creating custom Windows icons from screenshots*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/xm6aHzaC-D8/uD1PLfk6DAAJ>
o <https://i.postimg.cc/cHVqvPPb/icon03.jpg>
o <https://i.postimg.cc/3N7ZdRSb/icon02.jpg>
o <https://i.postimg.cc/vHc2THz3/icon01.jpg>

o *Tutorial with details to properly set {batch,shortcut,target} icons*
<https://groups.google.com/d/msg/alt.msdos.batch/ndNW-4oDewY/iQzDf15OBQAJ>

o *Tutorial to find all icons hidden inside common Windows executables & DLLs*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/-1nQdP8E_Yc/VILrouTSBAAJ>

o *Where to find thousands of free open source mobile device related icons*
<https://groups.google.com/forum/#!topic/alt.comp.freeware/0lQELGmVc0U>

o *Examples of custom icons used for various Windows shutdown shortcuts*
<https://groups.google.com/d/msg/alt.msdos.batch/ndNW-4oDewY/siPvrsBVBQAJ>

o *Tutorial to get batch command shortcuts working perfectly on Windows*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/1PzeGP4KMTU/tTbcd9zxAAAJ>

o *Here are over 250 Win+R > Run commands to set your shortcut TARGET to*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/cc1lGn3ty0E/DH_FxVCjAAAJ>

o *The unintuitive syntax to set a shortcut TARGET line to multiple commands*
<https://groups.google.com/d/msg/alt.msdos.batch/azQbz6D_v0Y/zwvOqeCmEAAJ>

o *What useful Windows shortcuts would you like to share with users?*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/80ZHKKFom0c/RN3V0Av6BQAJ>

o *Quick tutorial for creating easy (Start > Run) access to lookup files on Windows*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/5LxGOixwwWs/q8wVoJ3mBAAJ>

o *Tutorial for setting up a well-organized consistent efficient Windows menu system*
<https://groups.google.com/d/msg/microsoft.public.windowsxp.general/eWU-jOkFRtU/lkVU8yolBQAJ>

o *Shortcuts with special icons to shutdown & reboot Windows on command*
<https://groups.google.com/d/msg/alt.msdos.batch/ndNW-4oDewY/siPvrsBVBQAJ>
etc.
--
Every thread to Usenet archives should help someone now & in the future.

Kenny McCormack

unread,
Jun 17, 2020, 12:55:25 PM6/17/20
to
In article <rcbqi3$p4l$1...@news.mixmin.net>,
Arlen Holder <arlen...@newmachine.com> wrote:
>UPDATE:
>
>Today we solved the problem of adding modified windows icons
>to shortcut files which targeted multiple Windows commands.

It'd be nice if ot were possible to tell at a glance what the hell your
posts are about. Instead, they just look like screenful after screenful of
spammy URLs.

It should not be this hard.

--
Conservatives want smaller government for the same reason criminals want fewer cops.

Alan Baker

unread,
Jun 17, 2020, 2:28:08 PM6/17/20
to
On 2020-06-17 9:55 a.m., Kenny McCormack wrote:
> In article <rcbqi3$p4l$1...@news.mixmin.net>,
> Arlen Holder <arlen...@newmachine.com> wrote:
>> UPDATE:
>>
>> Today we solved the problem of adding modified windows icons
>> to shortcut files which targeted multiple Windows commands.
>
> It'd be nice if ot were possible to tell at a glance what the hell your
> posts are about. Instead, they just look like screenful after screenful of
> spammy URLs.
>
> It should not be this hard.
>

He doesn't actually know much, so all he can do is regurgitate.

nospam

unread,
Jun 18, 2020, 1:47:36 AM6/18/20
to
In article <rcdhts$iea$1...@news.xmission.com>, Kenny McCormack
<gaz...@shell.xmission.com> wrote:

> In article <rcbqi3$p4l$1...@news.mixmin.net>,
> Arlen Holder <arlen...@newmachine.com> wrote:
> > ...

>
> It'd be nice if ot were possible to tell at a glance what the hell your
> posts are about. Instead, they just look like screenful after screenful of
> spammy URLs.
>
> It should not be this hard.

it's not hard at all.

it's *very* easy to tell at a glance what his posts are about:

trolling.

Arlen Holder

unread,
Aug 29, 2020, 9:48:22 AM8/29/20
to
On Thu, 29 Aug 2019 16:24:14 -0000 (UTC), AG Holder wrote:

> SOLVED!
>
> Once I followed your helpful suggestion to give up on wasting time trying
> to get the the ampersand syntax to work with the app directly in the TARGET
> line, I then immediately figured out a way to incorporate the ampersand
> into the TARGET line anyway, which was to utilize the same technique we
> used in the past to combine commands to create a rolodex grep using nothing
> more than a simple call to a registry key.
>
> This is the simple solution (so far):
> o Calling the application directly doesn't allow the ampersand to work
> o But calling the app via the comspec _does_ allow the ampersand to work
>
> That is, this doesn't work:
> o TARGET = cmd1 & cmd2
> But this does work!
> o TARGET = %compspec% /k cmd1 & cmd2
>
> I should have remembered this, but my memory was tweaked by my last
> response, where we've solved so many Windows problems that we forget all
> the tricks - where the trick was that I had already used (long ago) this
> comspec /k concept to create a shortcut which spits out system snapshot
> information into a file, where, from memory, the TARGET line was something
> like the following that I just hacked out for this post:
>
> TARGET = %comspec% /k date /T > sys.txt & ipconfig /all >> sys.txt & route
> print >> sys.txt & netsh int ip show route >> sys.txt & systeminfo >>
> sys.txt & net start >> sys.txt & dir /s/a/l/on/b C:\ *.* >> sys.txt
>
> That same technique, which I had forgotten we used long ago to create
> system snapshots, worked fine with Veracrypt just now:
>
> TARGET = %comspec% /k veracrypt.exe [PUT THE FIRST MOUNT HERE] & [PUT THE SECOND MOUNT HERE]
>
> Now we have efficient shortcuts which mount & dismount ALL encrypted
> volumes in a single TARGET line.
>
> TARGET = veracrypt.exe /dismount /force
> TARGET = %comspec% /k veracrypt.exe /volume C:\tmp\X.hc /letter X /auto /quit /explore & veracrypt.exe /volume C:\tmp\Y.hc /letter Y /auto /quit /explore
>
> In summary, the simple trick was to NOT use the application commands
> directly in the shortcut TARGET, but to use the /k comspec switch first,
> and _then_ combine the two application commands.
>
> This concept of adding the ampersand to the shortcut TARGET line, of
> course, will have general use in the future, so it's great that we were
> able to add value to the Usenet potluck to share with the other team
> members who care to learn how to be extremely efficient on Windows.

Update (for the cross referenced permanent Usenet record)
o TARGET = %comspec% /c [1st command] & [2nd command & [3rd command]
o TARGET = %comspec% /k [1st command] & [2nd command & [3rd command]

I am setting up a new system after a BSOD failure to boot necessitated it:
o Windows 10 BSOD indicates a hardware problem - but what hardware is the problem?
<https://alt.comp.os.windows-10.narkive.com/oL7PTNKu/windows-10-bsod-indicates-a-hardware-problem-but-what-hardware-is-the-problem>

I first re-created these three basic Veracrypt links as described prior:
o What syntax combines 2 commands into a single shortcut TARGET line?
<https://groups.google.com/forum/#!topic/alt.msdos.batch/azQbz6D_v0Y>

1. Win+R > dismount (dismounts all mounted encrypted volumes, aka unmount)
2. Win+R > favorite (mounts favorite encrypted volumes)
3. Win+R > mountx (mounts encrypted volumes, where 'x' is a given volume)
(for example, mountxyz mounts three encrypted volumes as X, Y, & Z)

Those keywords are defined in the AppPaths key in the system registry:
o [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\]

1. dismount.exe === C:\path\lnk\dismount.lnk (aka c:\path\lnk\unmount.lnk)
2. favorite.exe === C:\path\favorite.lnk
3. mountx.exe === C:\path\lnk\mountx.lnk
(For example, mountxyz.exe === C:\path\lnk\mountxyz.lnk)

Where the TARGET lines for each of those shortcut (links) are:
1. dismount.lnk
TARGET === c:\path\veracrypt.exe /dismount /force /q /silent
2. favorite.lnk
TARGET === c:\path\veracrypt.exe /a favorites /q
3. mountx.lnk
TARGET === %comspec% /c veracrypt /volume C:\path\volume1.hc /letter x /auto /quit /explore

(For example, mountxyz.lnk)
TARGET === %comspec% /c veracrypt.exe /volume volume1.hc /letter x /auto /quit /explore
& veracrypt.exe /volume volume2.hc /letter y /auto /quit /explore
& veracrypt.exe /volume volume3.hc /letter z /auto /quit /explore

Shortcut targets are assigned appropriate easily distinguished icons, as per:
o Tutorial for creating custom Windows icons from screenshots using only Irfanview freeware
<https://groups.google.com/forum/#!topic/alt.comp.freeware/qeHbJySBp0M>

Note AppPaths keys are simply keywords that _must_ end with ".exe":
o What Windwos freeware adds powerful "phone Susan" & "vipw" commands?
<https://groups.google.com/forum/#!topic/microsoft.public.windowsxp.general/ySVGbayhLSk>
--
Usenet is a no-login web-searchable archive of useful crosslinked tutorials.

Arlen Holder

unread,
Sep 1, 2020, 2:07:21 AM9/1/20
to
QUESTION about TARGET multi-line-command syntax

1. This works from the Windows command line to kill all the users' tasks:
Win+R > cmd {ctrl+shft+enter} >
taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *

2. That also seems to work just fine from a shortcut TARGET line:
TARGET = taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *
START IN: C:\Windows\system32

3. It also seems to work in a comspec cmd (needed for multiple commands):
TARGET = %comspec% /c taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *
START IN: C:\Windows\system32

4. But it doesn't seem to work in multi-command shortcut comspec syntax:
TARGET = %comspec% /c "echo off | clip" & veracrypt /dismount /force /q & taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *
START IN: C:\Windows\system32

Q: What syntax change is needed to get that multi-line comspec cmd to work?

See also:
o Tutorial for creating cclip & killall clearing the Windows clipboard & killing users' tasks in one fell swoop
<https://groups.google.com/forum/#!topic/alt.msdos.batch/DqBXiTJ6FA0>
--
Sometimes you need just a little bit of syntactical help to get it working.
0 new messages