Fixed Win "set /p" not working in V17 build 53

rps

Jul 6, 2008
436
6
Set /p isn't working in V17.00.53 x64

Code:
D:\bat>set /p choice="Enter your choice: " & echo choice === %choice%
^C

D:\bat>ver

TCC  17.00.53 x64   Windows 7 [Version 6.1.7601]


D:\bat>set /p choice="Enter your choice: " & echo choice === %choice%
^C

D:\bat>

Works in V16.03.55 x64
Code:
C:\JPSoft\tcmd16x64>ver

TCC  16.03.55 x64   Windows 7 [Version 6.1.7601]


C:\JPSoft\tcmd16x64>set /p choice="Enter your choice: " & echo choice === %choice%
"Enter your choice: "3
choice === 3


C:\JPSoft\tcmd16x64>
 

gwgaston

Senior IT Security Consultant
May 28, 2008
57
1
SC
Confirmed here too... although it doesn't hang, but returns a double usage error message:

Code:
Usage : SET [/A /D /E /O /P /R file... /RO /S /U /V /X] [name[=][value ]]
Usage : SET [/A /D /E /O /P /R file... /RO /S /U /V /X] [name[=][value ]]

ref Help:

Definition mode:


SET [/A /D /O /S /U /V /E /RO /R [file...] | name=value | prompt ]

prompt Optional input prompt for the /P name= option.

Looks like if you remove the spaces in the prompt set 'prompts' for input, but still doesn't set the variable. If you remove the prompt entirely it works:

Code:
unset choice

set /p choice=Enteryourchoice: & echo choice === choice%
fred
choice ===

set /p choice= & echo choice === %choice%
gtrf
choice === gtrf
 

gwgaston

Senior IT Security Consultant
May 28, 2008
57
1
SC
Thanks Rex. I'm sure the OP (rps) appreciates your speedy work as well :) . I noticed the 'CMD expanding variable before set on same cmdline' thing and meant to mention it too, but of course that's only an issue with the echo output. The real issue was with the 'set /p' part which does work as written with CMD... I'm guessing rps made the example as a quick one liner for demonstration purposes only under TCC.
 
Similar threads
Thread starter Title Forum Replies Date
C Last TCMD that supports win 7? Support 5
vefatica Console cursor height in Win 10 Support 3
vefatica Win 10 to 7 VPN and UNC CWD Support 12
R How to? Win 10 virtual desktops and DESKTOP Support 4
Y TCC on Win 1709 Build 17063.1000 Support 5
fromano WAD ver /r does not detect Win 10B10166 Support 5
Alpengreis Win Firewall Inbound Rules (TCMD 16.x) Support 10
S Installing on Win 7 without invoking UAC Support 2
A Win 9x and Win ME Support 4
Roedy Win 7 freeze on DVD full Support 4
C file lists, excluding files, TC 8.x , win xp pro sp2 Support 1
V Set path permanently from within TCC? Support 3
S Debugger keeps breaking with no break point set. Support 1
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
R How to? Set default application in a special folder Support 4
A How to? Set up SMTP password in TCC-RT Support 1
vefatica WAD More SET /A woes Support 4
vefatica SET /A and multidimensional array. Support 1
M How to set Path variable for non-executable file extensions in 4DOS Support 8
D Need to set Take Command font size when switching to high DPI display Support 0
P "Set" command behavior - a bug? Support 3
M How to? Set the ribbon titles to mixed case Support 1
X How to set %_INIREAD result to variable Support 5
M WAD Set statements in () causes problems Support 8
M How to? How to set a default TITLE for newly opened tab? Support 2
M Fixed Set "VAR=VAL" format causes problems Support 12
vefatica SET /A var=expression=digits Support 3
cxxl Set encoding for batch file Support 4
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
vefatica SET /A var\=...? Support 10
dcantor Documentation SET /T: missing from heading Support 0
fpefpe Documentation Set /v Support 4
vefatica What's SET /Z? Support 1
R Fixed set /r has stopped working in build 35 Support 4
BeechComer Debugger: how to set %1 variable? Support 3
fpefpe How to? Global variable set /v Support 4
fpefpe Documentation Can the title line of tcmd be set? Support 4
J How to set working directory Support 10
Jay Sage Failure of ACTIVATE to Set a Window Position Support 3
vefatica SET /A "var%=N", TCC vs. CMD Support 0
J Set environment variable from stdout of command Support 3
B How to? Pre-set _tcfolder on startup when Folders is set Auto-Hide Support 6
Dan Glynhampton Fixed @version "force" flag not working, and unable to set separator Support 3
R WAD /= size ranges not set correctly Support 5
S How to? Set the timestamp of ZIP command built archive to match latest member Support 8
Mordachai Help! How to set parameters for script I'm debugging?! Support 6
Roedy SET= Support 2
A How to? Set up a log file for all command output Support 3
M Fixed character set in dir/copy Support 3
Phileosophos Fixed TakeCommand exits upon "set [" command Support 14

Similar threads