dos

calling Batch file in VBA not working properly

狂风中的少年 提交于 2019-12-13 15:27:40
问题 I'm trying to create a program that can be used by other people. Currently, my files are in the directory C:\Documents and Settings\jpmccros\Desktop\test This directory contains my macro.xlsm , names.bat , and another sub-directory called Data . The batch file names.bat does the following: cd data dir/b/o:n > names.txt This does exactly what I want it to do. When I open the batch file (which is in the directory C:\Documents and Settings\jpmccros\Desktop\test\ , the MS DOS Command Prompts

DIV instruction jumping to random location?

安稳与你 提交于 2019-12-13 15:17:45
问题 So I am having this exact problem. The solution given is to zero out DX , but in my case it already is! My program is to simply divide a 16 bit number by an 8 bit number. My code is: data segment num1 dw 0204h num2 db 02h quotient db ? remainder db ? data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax mov ax,num1 div num2 mov quotient,al mov remainder,ah mov ah,4ch int 21h code ends end start Any solution? 回答1: You badly need to start using whitespace to separate your

How to copy specific file types from one folder into another folder

≡放荡痞女 提交于 2019-12-13 14:49:50
问题 How do you copy specific file types from one folder into another folder while retaining the folder structure? The following batch command is capable of copying the specific file types to a folder, but lacks being able to retain the folder structure: for /R c:\source %%f in (*.cpp,*.h) do copy %%f x:\destination\ How could I modify this to keep the folder structure from the source? Thanks! 回答1: xcopy /e c:\source\*.xml x:\destination\ should do the job. See xcopy /? from the prompt for

I don't understand why my program isn't working

坚强是说给别人听的谎言 提交于 2019-12-13 11:24:22
问题 I am trying to write a code that read and write text file with interrupt 21h. here is my code: IDEAL MODEL small STACK 100h DATASEG filename db 'testfile.txt',0 filehandle dw ? Message db 'Hello world!' ErrorMsg db 'Error', 10, 13,'$' CODESEG proc OpenFile ; Open file for reading and writing mov ah, 3Dh mov al, 2 mov dx, offset filename int 21h jc openerror mov [filehandle], ax ret openerror: mov dx, offset ErrorMsg mov ah, 9h int 21h ret endp OpenFile proc WriteToFile ; Write message to file

How to disable the keyboard and mouse via assembly code

喜你入骨 提交于 2019-12-13 11:22:44
问题 I have tried to write an assembly code to hang the keyboard and mouse (I try with keyboard now) . I searched in everywhere nearly (in references and articles and the old topic here also) and almost all show the same code by fetch the address of INT 9 and create new interrupt then make it be called rather than the original interrupt(9) . That is my code i had written: .model tiny .stack 100h .data old_ISR dd ? .code main proc far mov ah,35h ; get interrupt vector mov al,09 ; for int 9 INT 21h

how to use long long keyword in Turbo C++ 3.2 compiler

回眸只為那壹抹淺笑 提交于 2019-12-13 09:45:19
问题 I am doing some emnedded work for which I am writing program in CPP. My machine has dos platform. In my program I am using long long keyword which is not working.I am using turboC++ 3.2 compiler. I have searched a lot and find C99 library has stdint.h file but how can i use this file with my compiler. Or some other comiler to work on embedded keywords which made dos based executable file. 回答1: You are using a platform from the 1980s, before C++ even existed as a standard. Even your int is

Window batch / DOS script to remove duplicate words in a string [closed]

你说的曾经没有我的故事 提交于 2019-12-13 09:05:29
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . Can anyone help me with window batch / DOS script to remove in a string. If the string is - test1 test2 test1 test3 test2 test3 I need a script to display as test1 test2 test3 回答1: the same way, you would do it manually: take every element, check if it already is in output, if not, append it: @echo

Rename different files to one file name, one at a time

浪子不回头ぞ 提交于 2019-12-13 08:58:40
问题 i have files named.. 82011.nsf 63113.nsf 55555.nsf i must rename each file to single.nsf (for example ren 82011.nsf to single.nsf) then use a program to act on that file (single.nsf) then rename the next file (63113.nsf to single.nsf) then use a program to act on that file (single.nsf) etc I want a batch file to do the nename, pause (so i can run the other program), then do the next rename until all nsf files are done. how? 回答1: for %i in (*.nsf) do ( rename %i single.nsf do_the_job pause )

Continuous numbering of files with bat-file

给你一囗甜甜゛ 提交于 2019-12-13 07:57:34
问题 I have a this folder where I keep all my .ild files. problem is that they should all be numbered, and I need a batch script to do this. I keep all my ilds in the folder ILDS. Right now I have these 3 files in the "ILDS" folder: 09.ild test.ild s p a c e d.ild How can i rename them, so they will be named: 1.ild 2.ild 3.ild Thanks! 回答1: You can loop over them and rename them setlocal enabledelayedexpansion set /a num=1 for %%a in (*.txt) do ( ren "%%a" "!num!%%~xa" set /a num+=1 ) 回答2: @echo

I can't get the right syntax to use WMIC in batch file

╄→尐↘猪︶ㄣ 提交于 2019-12-13 06:39:02
问题 Here's the command I'm trying to run. I wanted to get the service name for my SQL Server 2008 instance FOR /F "delims==" %%G IN ('wmic service where (displayname like ^"%%sqlserver2008%%^")') DO echo %%G 回答1: First you need to get the correct WMIC command, then you need to get it to work within a FOR command. The basic WMIC command you are looking for is: wmic service where "displayName like '%%sqlserver2008%%'" get name Now there are a few complications with FOR /F. WMIC output is in unicode