dos

search given set of files and copy to another directory

安稳与你 提交于 2020-01-06 06:46:22
问题 There is a given set of file names in a needToFind.txt file such as: myImage1.jpg , theImage.jpg, parisImage.jpg (This is a flie that I will format it does not matter filee names are seperated with comma, or line break) And there is a folder named /MyImageFolder, which contains lets say 1000 images, and also contains myImage1.jpg , theImage.jpg, parisImage.jpg I want to find those given images and copy them to another directory. I want to search given file names in needToFind.txt, in a

C++ Multi-thread text output print to dos console overlapped/Mess up the outputs

末鹿安然 提交于 2020-01-06 04:31:40
问题 I had a multi-thread program which execute from dos prompt, there are some prints and outputs dump to dos console using std::cout, but when thread1 and thread2 finished it jobs and then join() to main app, some printouts and outputs were overlapped and not aligned (no newline,running into each other). Sometime they are ok. If you have some advises, I am really appreciate for your helps. Andrew 回答1: Well, it's simple. Output has no concurrency control, you're getting data races. You need to

Grepping `reg query` result value?

强颜欢笑 提交于 2020-01-06 04:27:11
问题 Consider the following result from a hypothetical reg query : ..>reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MediaPlayer /v "I nstallation Directory" HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MediaPlayer Installation Directory REG_EXPAND_SZ %ProgramFiles%\Windows Media Play er How do I grep the output so that I can assign the actual value of the setting ( %ProgramFiles%\... ) into a variable (or temp file)? 回答1: example for batch files: @FOR /F "tokens=2* " %%A IN (

I am unable to use a debugger

余生长醉 提交于 2020-01-05 12:14:13
问题 I have started to learn assembly language. The assembler I am using is NASM. Operating system is windows 7 32 bit on VMWARE. I am learning the language by watching video tutorials in which the instructor is using advance fullscreen debugger. The problem is I don't have the notes he provided to his students in which he gave instruction about how to use AFD. I can't understand the use of AFD. So I decided to go for Ollydebug. My first assembly programming is a DOS application (COM) file. When I

Assembly on DOS (TASM), creating TSR with a new handler on int 21h

孤街醉人 提交于 2020-01-05 06:47:25
问题 I have a trouble with making TSR com file for DOS. It should set a new handler on a 21'th interrupt, terminate and stay resident. New handler should transfer control to an old interrupt 21h handler. I save its interrupt vector, but have no idea how to call it correctly. Here is a program: .model tiny .data old_int21h dw ?, ? .code org 100h start: ;saving old interrupt vector mov ax, 3521h int 21h mov [old_int21h], bx mov [old_int21h + 2], es ;setting new interrupt vector cli push ds push cs

run a input parameter as command in dos batch script?

浪尽此生 提交于 2020-01-05 04:16:06
问题 How can I run a command in my dos script from an input argument ? Simplified script bla.bat: CALL %1 Call it: bla.bat "echo 'hello'" (or bla.bat "git status") Error: '"git status"' is not recognized as an internal or external command, operable program or batch file. It works if I do "CALL git status". 回答1: It looks like the problem may be that you have surrounding quotes in your input, which you'll need to stop it being broken into the different %n arguments, but try: %~1 Which will strip any

Line ending issue DOS > Linux > Java

混江龙づ霸主 提交于 2020-01-04 04:11:08
问题 I'm having a bit of a trouble with a 160.000 lines file, this file was generated through an export from an xlsx file, it has a .txt extension but i'm afraid that it has been exported as DOS-like file, at the end of each line it has the DOS line break. I'm using a parser written in java, running on an Ubuntu environment, and i'm getting this when i run the parser (which i cannot edit because its part of a jar i cant access the source code), i get NumberFormatException where a number is

Automating old DOS application using Python

对着背影说爱祢 提交于 2020-01-04 04:00:51
问题 Is there a way to automate an old DOS application (16-bit, probably needs an emulator such as DOSBox) from Python (on Windows)? I would like to send keys and strings to the application, detect updates to the DOS "screen" and get the application output. It would be even better if the DOS application could run "hidden", i.e., not showing in the taskbar. Note: It is not a game, it is one of those old application where you are given menus with press 1 for something, press 2 for something else,

Source Insight 空格和Tab出现乱码

戏子无情 提交于 2020-01-03 00:58:01
最近从gitub上下载了一份linux源码,在windows10下用source insight打开,发现空格和Tab都出现了乱码。 开始的时候怀疑是Dos和Unix文件格式不同导致的,也就是说我可能下载的是unix格式的,但是在windows上变成了Dos格式的。 后来发现不是。 最后发现是在Options菜单下,有2个选项被我打开了。我们应该关闭Visble tabs 和Visble spaces,问题就解决了。 来源: https://www.cnblogs.com/ironx/p/6002233.html

%%F variable always referencing the last item in a FOR loop instead of the current one

好久不见. 提交于 2020-01-02 22:08:10
问题 This seems like is should be fairly simple, but I am having trouble getting a FOR loop in DOS to correctly report the current item it is evaluating. I have a simple DOS batch file that loops through all files in a directory and renames them. Let's say for example my directory contains the following files: File1.txt File2.txt File3.txt I want to remove the TXT extension from each file. So my batch command looks something like: @echo off for %%F in ("*.txt") do ( echo %%F set tmpFile=%%F echo