dos

Rename Multiple files with in Dos batch file

夙愿已清 提交于 2019-12-18 06:13:13
问题 I wish to rename all files inside the folder *.txt, so the result will be "1.txt", "2.txt" and "3.txt", .... How can I do so? 回答1: The following may accomplish what you are looking for. It uses a for loop to iterate through the text files and makes a "call" to another bit of the batch file to do the rename and increment of a variable. Edit Change math operation to cleaner solution suggested by Andriy. @echo off set i=1 for %%f in (*.txt) do call :renameit "%%f" goto done :renameit ren %1 %i%

Get STDOUT into a variable

淺唱寂寞╮ 提交于 2019-12-18 04:16:15
问题 Im using sendemail in a batch file. At the end of sending an email it replys with a message of succses or failure. For example Jan 10 00:46:54 villa sendemail[456]: Email was sent successfully! Is it possible to capture this message into a variable for processing? Thx 回答1: Yes, you need to execute sendmail through the for loop: for /f "tokens=*" %%a in ('[sendmail command line]') do ( set VAR=%%a ) After this runs, VAR will be set to the last line that sendmail output. You can then do

How does DOS load a program into memory?

*爱你&永不变心* 提交于 2019-12-17 18:18:56
问题 What steps does MS-DOS take to load a COM or EXE file into memory? Are there still references online as to how this happens? The best I can think of is possibly referring to dosbox source. 回答1: When command.com is asked to execute a .com or .exe file, it will call the interrupt service 21h/AH=4B, the EXEC service. It is up to the calling program to: build a DOS EXEC parameter block (see http://www.delorie.com/djgpp/doc/rbinter/it/90/15.html ) (includes information on environment variables,

How can I delete all files/subdirs except for some files in DOS?

让人想犯罪 __ 提交于 2019-12-17 16:30:35
问题 I'm looking for a DOS script to delete all files and subdirectories in a root directory except for a set of batch files (*.bat) that are in the root directory. Any DOS jocks out there that know an easy way to do this? Update Thanks for your help everyone. This is where I'm at now (see below). I'm using Ken's suggestion for the delete of the files. I would like to know how I can stop this script running if the del or RD commands fail due to a lock on a file/dir. Anyone know how? Right now,

dos命令大全

二次信任 提交于 2019-12-17 15:59:28
查看版本:ver 查看权限:whoami 查看配置:systeminfo 查看用户:net user 查看进程:tasklist 查看正在运行的服务:tasklist /svc 查看开放的所有端口:netstat -ano 查询管理用户名:query user 查看搭建环境:ftp 127.0.0.1 查看指定服务的路径:sc qc Mysql 添加一个用户:net user jianmei daxia.asd /add 提升到管理权限:net localgroup administrators jianmei /add 添加用户并提升权限:net user jianmei daxia.asd /add & net localgroup administrators jianmei /add 查看制定用户信息:net user jianmei 查看所有管理权限的用户:net localgroup administrators 加入远程桌面用户组:net localgroup "Remote Desktop Users" jianmei /add 突破最大连接数:mstsc /admin /v:127.0.0.1 删除用户:net user jianmei /del 删除管理员账户:net user administrator daxia.asd 更改系统登陆密码:net

TASM running LED animation with specific time of stop

和自甴很熟 提交于 2019-12-17 10:04:43
问题 Im very new in this assembly language can you guys help me .model small .stack .code org 100h start: main proc mov cx,1; how many times to loop here:mov al,00000001b mov dx,378h out dx,al call delay mov al,00000010b mov dx,378h out dx,al call delay mov al,00000100b mov dx,378h out dx,al call delay mov al,00001000b mov dx,378h out dx,al call delay mov al,00010000b mov dx,378h out dx,al call delay mov al,00100000b mov dx,378h out dx,al call delay mov al,01000000b mov dx,378h out dx,al call

Print integer to console in x86 assembly

流过昼夜 提交于 2019-12-17 07:38:04
问题 When I add two values in 16 bit assembly, what is the best way to print the result to console? At the moment I have this code: ;;---CODE START---;; mov ax, 1 ;put 1 into ax add ax, 2 ; add 2 to ax current value mov ah,2 ; 2 is the function number of output char in the DOS Services. mov dl, ax ; DL takes the value. int 21h ; calls DOS Services mov ah,4Ch ; 4Ch is the function number for exit program in DOS Services. int 21h ; function 4Ch doesn't care about anything in the registers. ;;---CODE

Embedding a DOS console in a windows form

那年仲夏 提交于 2019-12-17 04:59:11
问题 Is it possible to embed a DOS console in a Windows Form or User Control in C# 2.0? We have a legacy DOS product that my Windows app has to interact with, and it's been requested that an instance of the legacy product should run within the Windows application. At the moment, I'm using the user32.dll to locate the window that the DOS product is running in, minimising then maximising the window, and typing characters into the window. This isn't a very good solution to the problem, as it means my

Embedding a DOS console in a windows form

泪湿孤枕 提交于 2019-12-17 04:58:33
问题 Is it possible to embed a DOS console in a Windows Form or User Control in C# 2.0? We have a legacy DOS product that my Windows app has to interact with, and it's been requested that an instance of the legacy product should run within the Windows application. At the moment, I'm using the user32.dll to locate the window that the DOS product is running in, minimising then maximising the window, and typing characters into the window. This isn't a very good solution to the problem, as it means my

How buffered input works

你说的曾经没有我的故事 提交于 2019-12-17 04:36:13
问题 The input in next program works OK, but when I ask to display the output, DOS doesn't display anything at all! How is this possible? ORG 256 mov dx, msg1 mov ah, 09h ;DOS.WriteString int 21h mov dx, buf mov ah, 0Ah ;DOS.BufferedInput int 21h mov dx, msg2 mov ah, 09h ;DOS.WriteString int 21h mov dx, buf mov ah, 09h ;DOS.WriteString int 21h mov ax, 4C00h ;DOS.TerminateWithExitcode int 21h ; -------------------------------------- msg1: db 'Input : ', '$' buf: db 20 dup ('$') msg2: db 13, 10,