strange error in alias

Status
Not open for further replies.
Aug 31, 2011
5
0
OS: Vista Home Premium 64bit

C:\Windows\System32]alias kill 'c:\windows\system32\taskkill.exe /im %1 /t /f'

[C:\Windows\System32]kill
TCC: Unknown command "'c:\windows\system32\taskkill.exe"

taskkill is a Vista command, and when I try to create an alias called "kill" to invoke the command, I get the above error. I can type "taskkill" at the command prompt and I get the usual info about the command, but when I try to use the alias it's as if the taskkill command isn't found
 
Jun 2, 2008
359
4
OS: Vista Home Premium 64bit

C:\Windows\System32]alias kill 'c:\windows\system32\taskkill.exe /im %1 /t /f'

[C:\Windows\System32]kill
TCC: Unknown command "'c:\windows\system32\taskkill.exe"

taskkill is a Vista command, and when I try to create an alias called "kill" to invoke the command, I get the above error. I can type "taskkill" at the command prompt and I get the usual info about the command, but when I try to use the alias it's as if the taskkill command isn't found

I think what you're seeing is the result of the redirection in 64bit Windows. See Rex's response in this thread:

http://jpsoft.com/forums/support/3373-different-results-between-tcmd-cmd.html
 
Aug 31, 2011
5
0
Sorry, I guess I should have stated that I am running TCMD 64-bit.

Interestingly, if I put the same text into a btm file, it works fine. It seems that only the alias won't work.

Tom
 
Jun 2, 2008
359
4
Sorry, I guess I should have stated that I am running TCMD 64-bit.

Interestingly, if I put the same text into a btm file, it works fine. It seems that only the alias won't work.

Tom

Oh.. it's the single quotes you have around everything. Remove them and it should work fine.
 
Aug 31, 2011
5
0
Oh.. it's the single quotes you have around everything. Remove them and it should work fine.

[C:\Program Files\JPSoft\TCMD13x64]alias kill taskkill.exe /im %1 /t /f

[C:\Program Files\JPSoft\TCMD13x64]kill deskpins.exe
ERROR: Invalid syntax. Value expected for '/im'.
Type "TASKKILL /?" for usage.
 
Jun 2, 2008
359
4
[C:\Program Files\JPSoft\TCMD13x64]alias kill taskkill.exe /im %1 /t /f

[C:\Program Files\JPSoft\TCMD13x64]kill deskpins.exe
ERROR: Invalid syntax. Value expected for '/im'.
Type "TASKKILL /?" for usage.

Ok, you've got it running. :) But when you pass it the /im switch, it expects it to be followed by a value. Even without being in a alias, taskkill /im will give you the same error. It's when you run it without any parameters that it spits out the help.
 
Aug 31, 2011
5
0
Ok, you've got it running. :) But when you pass it the /im switch, it expects it to be followed by a value. Even without being in a alias, taskkill /im will give you the same error. It's when you run it without any parameters that it spits out the help.

The strange thing is, the %1 that I define into the alias is not stored. If I print out the alias the %1 is gone, so how do I pass a parameter to an alias on the command line?

I want to "kill deskpins.exe" but when I type it as a command, the alias doesn't contain the %1 so there's no place for the parameter to get passed.

[C:\Program Files\JPSoft\TCMD13x64]alias kill taskkill /im %1 /t /f

[C:\Program Files\JPSoft\TCMD13x64]alias kill
taskkill /im /t /f

notice the missing %1
 
Jun 2, 2008
359
4
The strange thing is, the %1 that I define into the alias is not stored. If I print out the alias the %1 is gone, so how do I pass a parameter to an alias on the command line?

I want to "kill deskpins.exe" but when I type it as a command, the alias doesn't contain the %1 so there's no place for the parameter to get passed.

Ah.. ok, that helps me understand what else I missed. Double up the percent like so:

alias kill c:\windows\system32\taskkill.exe /im %%1 /t /f
 
May 29, 2008
36
0
> I want to "kill deskpins.exe" but when I type it as a command, the alias
> doesn't contain the %1 so there's no place for the parameter to get passed.
>
You need to surround the alias with back quotes when you create it so that no
expansion or substitution is done until the alias is run:

alias kill `c:\windows\system32\taskkill.exe /im %1 /t /f`
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Strange error messages from TCC in FTP copy Support 7
vefatica REGDIR, strange error message Support 7
J Strange error: unset /s Support 14
J ASSOC / FTYPE strange error message Support 3
R strange bug? Support 7
Jesse Heines Strange Line Wrapping Behavior Support 14
F strange results Support 9
M Another possibly strange remote registry issue Support 5
forbin Strange handling of [nonbright] magenta background (v22) Support 2
N Fixed Strange dir behavior Support 6
T WAD Strange Unexpected "features" in the Debugger Support 2
P Strange mouse behavior with list Support 2
vefatica Strange tcc.exception.log Support 7
vefatica A strange one Support 0
D Strange DO behavior with /O Support 5
Glenn Bowes Strange text at startup Support 5
Steve Pitts WAD Strange output from DEL of a non-existent directory Support 7
vefatica Big numbers, strange errors Support 1
aedthuio Strange... lpksetup Support 4
CWBillow dir /4 strange Support 2
D Strange issue with FOR loop Support 15
MikeBaas Strange prob with %@replace.. Support 4
vefatica OT: strange files in %TEMP Support 10
Dan Glynhampton Documentation v15 help: Strange links in @INT topic Support 0
R WAD Strange output from "memory" command Support 1
M Yet another strange something re something called "@TCONVERT" Support 8
Roedy How to? Strange colours Support 9
M WAD Strange "Start" misbehavior... Support 10
vefatica Very strange console font corruption Support 3
Steve Pitts Strange problem with FREE Support 10
newgeekorder Debugger IDE - strange tab and parameter behaviour Support 1
Exolon Strange Prompt. Support 6
vefatica Strange folders Support 1
T Strange CPU value Support 3
M Strange behavior... Support 2
CWBillow Strange happenings Support 2
B Strange handling of a .BAT file Support 5
vefatica Strange behavior reloading SHRALIAS sav files. Support 1
D Strange crashes in @CRC32 and @MD5 Support 9
Charles Dye Strange output, here-doc redirection, TYPE, //UnicodeOutput=Yes Support 6
S Strange CHKDSK behavior Support 6
vefatica Strange results with CP 1252 Support 12
S Strange REN problem - non-English characters Support 3
dcantor Strange status in ACTIVATE command Support 0
C Copy (sys) error Support 3
T Error: This page can’t be displayed Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct. Support 8
kb6ojs How to? "Specified Account Already Exists" error installing TCMD v27 Support 12
samintz How to? Abort on error DO loop Support 10
mfarah Fixed The DATE command produces the wrong error message. Support 1
vefatica ON ERROR terminates DO loop. Support 0

Similar threads