中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 13:39
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室)  Moderators: lxmxnHAT
View digest  14,900 threads / 596 pages
Subject Author Replies / Views Last post
[求助]如果通过批处理修改文本文件... rickche 2 / 1,964 2011-01-18 13:40
rickche
tasklist检测到屏保进程就关机 418180315 4 / 1,926 2011-01-17 21:13
Hanyeguxing
Batch script can't shut down the computer 418180315 3 / 2,008 2011-01-17 19:08
cyn01livecn
[Original][Top Quality] Super Simple Code to Create Perfect Dos Edit Notepad zc99 1 / 2,103 2011-01-17 19:02
cyn01livecn
【算是月贴】我尽量减少闪烁的批处理大时钟 523066680 22 / 6,793 2011-01-17 18:52
cyn01livecn
How to backup the file with the largest timestamp in a directory hb3937 3 / 2,017 2011-01-17 17:55
hb3937
批处理运行一段时间退出(已解决,感谢:) modestleaner 7 / 2,161 2011-01-17 12:24
radem
Batch script to calculate the value of 1+2+3+4……+100 ```batch @View code @echo("off @setlocal @set sum=0 @for /l %%i in (1,1,100) do ( @set /a sum=%%i+sum ) @echo The sum is %sum% @endlocal ``` 批处理计算1+2+3+4……100的值 ```batch @View code @echo("off @setlocal @set sum=0 @for /l %%1 in (1,成成,public) out of order ``` 批处理计算1+2+3+4……100的值 ```batch @View code @Manual code和Well-sent code【是成成、public.com的输出成乱了】 @echo("Some random characters" @setlocal @set sum=0 @for (1,1,100) do ( 成成 ) @echo The out-of-order sum is %sum% @endlocal ``` Batch script to calculate the value of 1+2+3+4……+100 ```batch @View code @echo("off @setlocal @set sum=0 @for /l %%i in (1,1,100) do ( @set /a sum=%%i+sum ) @echo The sum is %sum% @endlocal ``` 批处理计算1+2+3+4……100的值 ```batch @View code @echo("off @setlocal @set sum=0 @for /l %%1 in (1,成成,public) out of order ``` 批处理计算1+2+3+4……100的值 ```batch @View code @Manual code和Well-sent code【是成成、public.com的输出成乱了】 @echo("Some random characters" @setlocal @set sum=0 @for (1,1,100) do ( 成成 ) @echo The out-of-order sum is %sum% @endlocal ``` Batch script to calculate the value of 1+2+3+4……+100 ```batch @echo off @setlocal enabledelayedexpansion @set sum=0 @for /l %%i in (1,1,100) do ( set /a sum=!sum!+%%i ) @echo The sum is %sum% @endlocal ``` 批处理计算1+2+3+4……100的值 ```batch 【成成都成了public的输出 said is成成,请说成成】 ``` Batch script to calculate the value of 1+2+3+4……+100 ```batch @echo off @setlocal enabledelayedexpansion @set sum=0 @for /l %%i in (1,1,100) do ( set /a sum=!sum!+%%i ) @echo The sum is %sum% @endlocal ``` 批处理计算1+2+3+4……100的值 ```batch 【成成都成了public的输出 said is成成,请说成成】 ``` Batch script to calculate the value of 1+2+3+4……+100 ```batch @echo off @setlocal enabledelayedexpansion @set sum=0 @for /l %%i in (1,1,100) do ( set /a sum=!sum!+%%i ) @echo The sum is %sum% @endlocal ``` Okay, let's go through this step by step. First, the user is trying to get batch scripts to calculate the sum of 1 to 100. Let's handle each part properly. The first set of code that's mostly correct is: ```batch @echo off @setlocal enabledelayedexpansion @set sum=0 @for /l %%i in (1,1,100) do ( set /a sum=!sum!+%%i ) @echo The sum is %sum% @endlocal ``` Then there are some parts with garbled text which we can just note the correct structure. The key is to present the correct batch script for calculating the sum from 1 to 100. So compiling the correct translations and code blocks: Batch script to calculate the value of 1+2+3+4……+100 ```batch @echo off @setlocal enabledelayedexpansion @set sum=0 @for /l %%i in (1,1,100) do ( set /a sum=!sum!+%%i ) @echo The sum is %sum% @endlocal ``` For the parts with garbled text, since they don't contribute to the correct functionality, we can just focus on the valid code. The final translated and correct code block for calculating the sum from 1 to 100 in batch is as above. 523066680 21 / 5,320 2011-01-17 10:37
726842270
How to read the value of a web application benetqxk 3 / 1,866 2011-01-17 09:01
Hanyeguxing
[Help]Often when writing batch processing, there is "There should not be goto here at this time" doslike 2 / 2,286 2011-01-17 02:33
726842270
[求助]关于小红锁文件夹加密工具 whiteyoo 5 / 2,469 2011-01-16 18:37
mxt963
[已结]怎样让DOS 命令窗口隐藏? ruisoft 21 / 6,538 2011-01-15 17:42
modestleaner
求助!两个文本比较 xyz1234111 13 / 2,452 2011-01-15 13:57
modestleaner
Delete the files generated two days ago 418180315 1 / 2,141 2011-01-15 02:55
Hanyeguxing
求 goto :eof结合call的用法 ieutk 21 / 8,076 2011-01-15 00:04
zaixinxiangnian
[Attachment] 想用批处理做一个一键还原 edzn 22 / 7,216 2011-01-14 22:37
liuli17695
GOTO:EOF Newcomers who don't know how to use it, please look here YoDe 11 / 5,510 2011-01-14 22:36
zaixinxiangnian
Regarding wfr replacement text g1325 3 / 1,878 2011-01-14 19:06
g1325
[求助]FOR IN里的文件名有空格,需要如何处理一下? xilianghe 7 / 2,416 2011-01-14 17:37
eminjin
怎么用一个文件里的内容命令文件 van416 4 / 1,879 2011-01-14 17:28
eminjin
批处理中百分号怎么运用 425354203 1 / 1,911 2011-01-14 17:02
eminjin
[Discussion]MS-DOS batch processing is the core ZHOU5509 2 / 1,955 2011-01-14 17:00
eminjin
How to use batch processing to make an automatic connection liuye851 2 / 2,197 2011-01-14 16:53
eminjin
求助,如何使用bat在txt中插入换行符 useasd 3 / 1,821 2011-01-14 16:36
eminjin
Copying files over the network stevendon 2 / 2,054 2011-01-14 16:27
eminjin
Prev  13 4 5 6 7 8 9596  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023