%systemroot% doesn't expand

Nov 3, 2010
9
0
#1
Hello,

I'm running TCC on WinXP

C:\WINDOWS\system32>ver
TCC 9.02.151 Windows XP [Version 5.1.2600]

If I try to execute a .msc form the TCC command prompt I get an error:

C:\WINDOWS\system32> dfrg.msc
TCC: (Sys) The system cannot find the path specified.
"%SystemRoot%\system32\mmc.exe"

If I try the same thing in cmd.exe, I don't get the error:

C:\WINDOWS\system32>cmd.exe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32> dfrg.msc

Here the dfrg gui executes properly.

Can someone suggest a fix for this or why it works in CMD but not TCC?

Thanks
 

dim

Dimitry Andric
May 31, 2008
204
1
Netherlands
#2
On 2010-11-09 14:49, CaesarR wrote:

> C:\WINDOWS\system32>ver
> TCC 9.02.151 Windows XP [Version 5.1.2600]
>
> If I try to execute a .msc form the TCC command prompt I get an error:
>
> C:\WINDOWS\system32> dfrg.msc
> TCC: (Sys) The system cannot find the path specified.
> "%SystemRoot%\system32\mmc.exe"
>
> If I try the same thing in cmd.exe, I don't get the error:
Does the following print 2 (e.g. REG_EXPAND_SZ):

echo %@regtype[HKCR\MSCFile\Shell\Open\Command\]

? And what does this print:

echo %@regquery[HKCR\MSCFile\Shell\Open\Command\]

? On my system, it results in:

%SystemRoot%\system32\mmc.exe "%1" %*

and running a .msc file from the command line works fine.
 
Nov 3, 2010
9
0
#3
Hello dim,

On Tue, 09 Nov 2010 09:05:29 -0500, dim <> wrote
Re RE: [Support-t-2412] %systemroot% doesn't expand:


>Does the following print 2 (e.g. REG_EXPAND_SZ):
>
> echo %@regtype[HKCR\MSCFile\Shell\Open\Command\]
>
>? And what does this print:
It prints "1"


> echo %@regquery[HKCR\MSCFile\Shell\Open\Command\]
>
>? On my system, it results in:
>
> %SystemRoot%\system32\mmc.exe "%1" %*
It prints C:\WINDOWS\system32\mmc.exe ""


>and running a .msc file from the command line works fine.
So there is a difference between what my system prints for the above
two items, and what your system prints. That may be the problem.

But then I wonder why can I run a .msc file in CMD, but not TCC?
 
#4
---- Original Message ----
From: CaesarR
...
| So there is a difference between what my system prints for the above
| two items, and what your system prints. That may be the problem.

You can use the method described in the old thread you already discovered - which relates to VBS - on how to fix the registry entries. BTW, is your XP up to SP3? If not, you ought to update it first.

| But then I wonder why can I run a .msc file in CMD, but not TCC?

This is just a guess: TCC uses the DOCUMENTED method, CMD uses an undocumented method.
--
Steve
 

dim

Dimitry Andric
May 31, 2008
204
1
Netherlands
#5
On 2010-11-09 18:45, CaesarR wrote:

>> echo %@regquery[HKCR\MSCFile\Shell\Open\Command\]
>>
>> ? On my system, it results in:
>>
>> %SystemRoot%\system32\mmc.exe "%1" %*
> ---End Quote---
> It prints C:\WINDOWS\system32\mmc.exe ""
Aha, so it seems the %1 and the %* are missing from the command line. Try running this:

echo %@regset[HKCR\MSCFile\Shell\Open\Command\,2,%%SystemRoot%%\system32\mmc.exe "%%1" %%*]

which should echo 0 if it succeeds.
 
#6
On Tue, 09 Nov 2010 14:05:58 -0500, dim <> wrote:

|On 2010-11-09 18:45, CaesarR wrote:
|
|
|---Quote---
|>> echo %@regquery[HKCR\MSCFile\Shell\Open\Command\]
|>>
|>> ? On my system, it results in:
|>>
|>> %SystemRoot%\system32\mmc.exe "%1" %*
|> ---End Quote---
|> It prints C:\WINDOWS\system32\mmc.exe ""
|---End Quote---
|Aha, so it seems the %1 and the %* are missing from the command line. Try running this:
|
| echo %@regset[HKCR\MSCFile\Shell\Open\Command\,2,%%SystemRoot%%\system32\mmc.exe "%%1" %%*]
|
|which should echo 0 if it succeeds.

If he's going to do that, he should also change the type to 2 (REG_EXPAND_SZ).
He said it was 1 (REG_SZ). I'd use RegEdit ... clear the "(Default)" value,
change its type to REG_EXPAND_SZ, and give it the value:

%SystemRoot%\system32\mmc.exe "%1" %*
 

dim

Dimitry Andric
May 31, 2008
204
1
Netherlands
#7
On 2010-11-09 23:34, vefatica wrote:

> If he's going to do that, he should also change the type to 2 (REG_EXPAND_SZ).
> He said it was 1 (REG_SZ). I'd use RegEdit ... clear the "(Default)" value,
> change its type to REG_EXPAND_SZ, and give it the value:
There's no need, %@regset[] can change the type and the value in one fell swoop.
 
Jun 3, 2008
27
0
#8
On Tue, 09 Nov 2010 17:58:14 -0500, dim <> wrote
Re RE: [Support-t-2412] %systemroot% doesn't expand:


>On 2010-11-09 23:34, vefatica wrote:
>
>
>---Quote---
>> If he's going to do that, he should also change the type to 2 (REG_EXPAND_SZ).
>> He said it was 1 (REG_SZ). I'd use RegEdit ... clear the "(Default)" value,
>> change its type to REG_EXPAND_SZ, and give it the value:
>---End Quote---
>There's no need, %@regset[] can change the type and the value in one fell swoop.
How would I use regset[] to do that? I don't know enough about regset
or the registry to attempt it.
 
Aug 9, 2009
133
0
#9
dim


> On 2010-11-09 23:34, vefatica wrote:
>
>
> ---Quote---
> > If he's going to do that, he should also change the type to 2 (REG_EXPAND_SZ).
> > He said it was 1 (REG_SZ). I'd use RegEdit ... clear the "(Default)" value,
> > change its type to REG_EXPAND_SZ, and give it the value:
> ---End Quote---
> There's no need, %@regset[] can change the type and the value in one fell swoop.
Using @regset[] leaves it open to TYPO's using the GUI doesn't
It has its advantages but for simplicity the GUI is damn near perfect all the time!
 
#11
----- Original Message -----
From: Kachupp
To: [email protected]
Sent: Tuesday, 2010. November 9. 19:25
Subject: RE: [Support-t-2412] %systemroot% doesn't expand


dim



Quote:
> On 2010-11-09 23:34, vefatica wrote:
>
>
> ---Quote---
> > If he's going to do that, he should also change the type to 2 (REG_EXPAND_SZ).
> > He said it was 1 (REG_SZ). I'd use RegEdit ... clear the "(Default)" value,
> > change its type to REG_EXPAND_SZ, and give it the value:
> ---End Quote---
> There's no need, %@regset[] can change the type and the value in one fell swoop.

Using @regset[] leaves it open to TYPO's using the GUI doesn't
It has its advantages but for simplicity the GUI is damn near perfect all the time!


Really? You still need to type things, e.g., the name, value and type of a key, etc. - I presume you NEVER mistype into a GUI interface, only into a text-mode interface!
--
Steve
 
Aug 9, 2009
133
0
#12
>
> dim
>
>
>
> Quote:
> > On 2010-11-09 23:34, vefatica wrote:
> >
> >
> > ---Quote---
> > > If he's going to do that, he should also change the type to 2 (REG_EXPAND_SZ).
> > > He said it was 1 (REG_SZ). I'd use RegEdit ... clear the "(Default)" value,
> > > change its type to REG_EXPAND_SZ, and give it the value:
> > ---End Quote---
> > There's no need, %@regset[] can change the type and the value in one fell swoop.
>
> Using @regset[] leaves it open to TYPO's using the GUI doesn't
> It has its advantages but for simplicity the GUI is damn near perfect all the time!
>
>
> Really? You still need to type things, e.g., the name, value and type of a key, etc. - I presume
> you NEVER mistype into a GUI interface, only into a text-mode interface!
> --
> Steve
TYPO errors in the @regset[HIVE KEY NAMES] those silly little typos that SLIP IN