dos

Using echo without trailing space in DOS

只谈情不闲聊 提交于 2019-12-22 05:21:59
问题 I noticed that when I use echo to print something to a file in DOS, a space is appended to the string. I need to print the string without the trailing space. Is there a way to do that, or as a workaround, remove trailing spaces from the file? 回答1: If I understood the problem correctly, you wrote the trailing space. Instead of echo string > file use echo string>file 回答2: Assuming you're talking about cmd.exe rather than the actual (rather outdated) MSDOS, there are a number of ways to do this,

what could cause PUSHD to fail?

﹥>﹥吖頭↗ 提交于 2019-12-22 04:48:24
问题 I've got a great big script that is entirely reliant on PUSHD. However suddenly when I type pushd \\server1\dir1 I'm getting: C:\Documents and Settings\userNameHere>pushd \\server1\dir1 ' ' CMD does not support UNC paths as current directories. OK, I'm aware that CMD doesn't support UNC paths. That's why I'm using PUSHD. When I search for this I find lots of posts that say "When you encounter this message about UNC paths, you should use PUSHD!". Well crap, I'm encountering that message and

How to make startup tasks idempotent?

China☆狼群 提交于 2019-12-22 04:32:22
问题 I have a number of startup tasks in batch files. In particular I call IIS's appcmd.exe to configure IIS. Startup tasks in Azure are supposed to idempotent (ie, able to be run repeatedly with the same results), in case the role is restarted for some reason. Unfortunately many of my IIS configuration commands will fail the second time around, eg because they delete a configuration node the first time which is then not present on subsequent runs. My question is, how do I make these startup tasks

Help Writing TSR Program(s) in NASM Assembly for DOS

时间秒杀一切 提交于 2019-12-22 04:05:29
问题 I've been trying to write TSR (Terminate-Stay-Resident) programs (in general) in Assembly (16-bit) for MS-DOS. I've read through a Wikipedia page on TSR and also a page on using it specifically in DOS (but it seems to be teaching it in C and not Assembly directly). I've looked at a site with tons of DOS interrupt documentation and find this one, this one, and another most relevant to TSR programs. I can't post all of the links because as a new user I can have up to 2 hyperlinks on a post. So,

Linux命令之dos2unix

吃可爱长大的小学妹 提交于 2019-12-21 20:14:37
Linux命令之dos2unix (2011-09-22 11:24:06) 转载 ▼ 标签: 杂谈 Linux命令之dos2unix - 将DOS格式文本文件转换成UNIX格式 用途说明 dos2unix命令用来将DOS格式的文本文件转换成UNIX格式的(DOS/MAC to UNIX text file format converter)。DOS下的文本文件是以\r\n作为断行标志的,表示成十六进制就是0D 0A。而Unix下的文本文件是以\n作为断行标志的,表示成十六进制就是 0A。DOS格式的文本文件在Linux底下,用较低版本的vi打开时行尾会显示^M,而且很多命令都无法很好的处理这种格式的文件,如果是个shell脚本,。而Unix格式的文本文件在Windows下用Notepad打开时会拼在一起显示。因此产生了两种格式文件相互转换的需求,对应的将UNIX格式文本文件转成成DOS格式的是unix2dos命令。 常用参数 将DOS格式文本文件转换成Unix格式,最简单的用法就是dos2unix直接跟上文件名。 格式:dos2unix file 如果一次转换多个文件,把这些文件名直接跟在dos2unix之后。(注:也可以加上-o参数,也可以不加,效果一样) 格式:dos2unix file1 file2 file3 格式:dos2unix -o file1 file2

web攻击之四:DOS攻击

那年仲夏 提交于 2019-12-20 20:26:46
DDOS是DOS攻击中的一种方法。   DoS:是Denial of Service的简称,即拒绝服务,不是DOS操作系统,造成DoS的攻击行为被称为DoS攻击,其目的是使计算机或网络无法提供正常的服务。最常见的DoS攻击有计算机网络带宽攻击和连通性攻击。   DDOS:分布式拒绝服务(DDoS:Distributed Denial of Service)攻击指借助于客户/服务器技术,将多个计算机联合起来作为攻击平台,对一个或多个目标发动DDoS攻击,从而成倍地提高拒绝服务攻击的威力。   举一个最通俗的例子,下面的图片是TCP的通信的三次握手,如果说攻击端,发送完第一次握手的数据后,然后就“消失”了,那么服务器就会不断的发送第二次握手的数据,可是攻击端的人找不到了。于是,服务器的资源大量被消耗,直到死机为止。当然要完全弄懂机制,需要对TCP有相当深入的了解。   事实上DOS的攻击方式有很多种,比如下面的常见的:   1、SYN FLOOD   利用服务器的连接缓冲区(Backlog Queue),利用特殊的程序,设置TCP的Header,向服务器端不断地成倍发送只有SYN标志的TCP连接请求。当服务器接收的时候,都认为是没有建立起来的连接请求,于是为这些请求建立会话,排到缓冲区队列中。   如果你的SYN请求超过了服务器能容纳的限度,缓冲区队列满,那么服务器就不再接收新的请求了

Multiple do commands in a for loop: Echoing a string to a file and then redirecting to the command window

谁说胖子不能爱 提交于 2019-12-20 18:34:02
问题 I am trying to write a batch file to iteratively execute a fortran compiled executable. Normally one would go to the windows command prompt, type 'Model.exe'. This would bring up a dos command window asking the user to type a required file name directly in to the command window at the dos prompt. I want to write a batch file that will do this bit for me, and also iterate this step so that I can run 10 simulations consecutively instead of having to do it by hand. This kind of shell operation

DOS echo %variable% “Echo is ON”

醉酒当歌 提交于 2019-12-20 07:36:18
问题 I have a dos batch file. mycommand.exe>c:\temp find /B Serv c:\temp>c:\temp2 set /p var1=<c:\temp2 SET var2=%var1:~-7% echo %var2% This is only DOS, not windows environment. The problem is that, the batch file output is: "Echo is ON". Can't echo the VAR2 variable. mycommand.exe is a simple app. Not important. > type c:\temp" VERSION 45.2 TAG1 NUMBER is 1234567 Serv NUMBER is 9654754 > type c:\temp2 c:temp Serv NUMBER is 9654754 What can I do, If I would like echo the VAR2 variable? I can't

Retrieving the command output of a hidden console?

天涯浪子 提交于 2019-12-20 06:19:03
问题 I run a DOS command from a python environment which retrieves its command output via stdout. All is working fine excepted that the windows console pops out everytime the script runs, so I need a way to hide the windows console. Schematically, here is the expected process: "Console1" runs "hidden Console2" and retrieves its output into "Console1" I read some recommendations with softwares like " HiddenStart " or " chp " which hide the console when executing DOS commands and batch scripts.

Dos instruction 3Bh on emu8086 changing working directory

谁都会走 提交于 2019-12-20 05:46:20
问题 I have recently started learning x8086 instructions and knowledge on instructions is rather poor. I am trying to change the current working directory using dos function 3Bh and then create a folder named "test2" on the directory using 39h. Can't understand what the problem is or is it a emu8086 issue. .MODEL SMALL,C .STACK .DATA CD db "c:\test1",0 dir db "test2",0 .CODE mov ax,@data mov ds,ax; mov dx,offset CD mov ah,3Bh int 21h mov dx, offset dir mov ah, 39h int 21h mov ah,4ch int 21h 回答1: