China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 07:36
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » This post has errors, please don't enter again!!! View 2,995 Replies 21
Original Poster Posted 2008-03-31 15:12 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
When writing batch scripts, we often need to use the backspace key. But I believe many people don't know how to input the backspace character "" (note that it's a backspace key, not a space) in cmd. I used to just copy it from others' batch scripts.

For this problem, I specifically searched on Baidu and finally found the input method (although it still requires copying): Enter edit in cmd to enter the text editor, then directly press the backspace key on the keyboard, then copy with ctrl+c and paste to the place needed with ctrl+v.
==============================================
Now an experimental second method (the most convenient and quick) is found: Open txt and directly press ctrl+backspace. By the way, my environment is XPSP2.
===================================
I'm sorry everyone. After repeated experiments, it's proved that both methods I mentioned are wrong.

[ Last edited by zw19750516 on 2008-5-19 at 09:47 PM ]
批处理之家新域名:www.bathome.net
Floor 2 Posted 2008-03-31 15:17 ·  中国 香港 腾讯云
银牌会员
★★★
Credits 1,436
Posts 739
Joined 2007-10-11 17:44
18-year member
UID 99469
Gender Male
Status Offline
Floor 3 Posted 2008-03-31 15:17 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
The ASCII code of that key seems to be 127. Open Notepad, press alt+127 and then copy.
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 4 Posted 2008-03-31 16:51 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 2,268
Posts 879
Joined 2006-12-19 16:23
19-year member
UID 73968
Gender Male
Status Offline
Hehe, the several methods mentioned above don't get backspace, they just look like black boxes, but they aren't backspace. I've always wanted a quick way to get it, but I still haven't.
致精致简!
Floor 5 Posted 2008-03-31 17:06 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by 26933062 at 2008-3-31 16:51:
Hehe, the several methods mentioned above don't get backspace, just look like a black box, but it's not backspace. I've been wanting a quick way to get it, but never have.

  The proof method is to copy backspace then enter cmd, first move the cursor to the back and then paste to see if the cursor moves forward by one grid.
  I can guarantee that using the second method in XPSP2 environment definitely types out backspace!
批处理之家新域名:www.bathome.net
Floor 6 Posted 2008-03-31 17:35 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Originally posted by 26933062 at 2008-3-31 04:51 PM:
Hehe, the several methods mentioned above all don't get backspace, just look like a black square, but it's not backspace. I've been wanting to have a quick method to get it, but always haven't.


Hmm, indeed, that alt+127 is "del"
But the effect is similar
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 7 Posted 2008-03-31 18:02 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 2,268
Posts 879
Joined 2006-12-19 16:23
19-year member
UID 73968
Gender Male
Status Offline
Originally posted by zw19750516 at 2008-3-31 17:06:

The proof method is to copy the backspace and then enter cmd, first move the cursor to the back point, and then paste to see if the cursor moves forward by one grid.
I can guarantee that the second method will definitely type the backspace in the XPSP2 environment!


The following code uses backspace, and the display result should be a row of English letters, and Chinese characters are not visible.
Try it with your method?
:

@echo off
setlocal enabledelayedexpansion
set "backspace="
set "var=Is the proof copying backspace"
set/p=%var%<nul
for /l %%a in (1 1 20) do set /p=!backspace!<nul
set/p=ierythgfdkjghfdsiygsdfghsfdg
pause>nul
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
plp626 +4 2008-04-01 12:19
致精致简!
Floor 8 Posted 2008-03-31 19:49 ·  中国 广东 阳江 电信
初级用户
Credits 92
Posts 49
Joined 2006-10-22 12:22
19-year member
UID 67712
Gender Male
Status Offline
Hehe, learned another trick again, thanks
Floor 9 Posted 2008-04-01 12:19 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
It's really that without communication, progress is hard to make
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 10 Posted 2008-04-01 14:22 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Actually, it's also easy to input. Just open any hex editor, such as UE, then switch to hex mode and input a 08.

What the LZ described about inputting Ctrl+BS in Notepad is 0x7F, which is 127, and this should be the DEL key, not the backspace key. Test environment: Chinese XP SP2.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 11 Posted 2008-04-02 15:19 ·  中国 广东 珠海 电信
初级用户
★★
Credits 97
Posts 51
Joined 2008-03-19 15:26
18-year member
UID 113404
Gender Male
Status Offline
Study! Ctrl+BackSpace is not..
Floor 12 Posted 2008-04-03 16:47 ·  中国 广西 防城港 电信
中级用户
★★
海浪人生
Credits 206
Posts 103
Joined 2007-07-04 00:18
19-year member
UID 93068
Gender Male
Status Offline
Please provide the specific Chinese text that needs to be translated. Without the Chinese content, I can't perform the translation.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
knoppix7 -1 2008-04-03 18:53
Floor 13 Posted 2008-04-07 19:23 ·  中国 甘肃 兰州 电信
初级用户
Credits 47
Posts 31
Joined 2008-03-17 19:04
18-year member
UID 113236
Gender Male
Status Offline
Really learned. I didn't know before.
Floor 14 Posted 2008-04-12 16:29 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
For this problem, I specifically searched on Baidu and finally found the input method (although copying is also required): Enter edit in cmd to enter the text editor, then directly press the backspace key on the keyboard, then ctrl+c to copy and then ctrl+v to paste to the place you need.



Your first method doesn't work either!

I tried it. If what I said is incorrect, please point it out by the owner:

Pressing backspace under edit doesn't get any visible characters. If there are characters to the left of the cursor, it will only delete the characters to the left.

Also, under edit, you can't directly use ctrl+c to copy to Notepad,
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 15 Posted 2008-04-25 10:52 ·  中国 广东 江门 蓬江区 电信
初级用户
Credits 29
Posts 15
Joined 2008-04-23 20:23
18-year member
UID 116742
Gender Male
Status Offline
Press ALT+8 in Notepad++ to get the backspace character, then copy it into the text... Pressing ALT+8 in text just performs the operation
Forum Jump: