dos

DOS : how do you run a batch without having to login on a share?

I'm running an xcopy command in a batch script which copies a file to a shared drive on another workstation; however the workstation requires a login before connecting to the share. Is there a way to script the login/connect into the batch file? thanks in advance ...

How does Windows determine/handle the DOS short name of any given file?

I have a folder with these files: alongfilename1.txt <--- created first alongfilename3.txt <--- created second When I run DIR /x in command prompt, I see these short names assigned: ALONGF~1.TXT alongfilename1.txt ALONGF~2.TXT alongfilename3.txt Now, if I add another file: alongfilename1.txt alongfilename2.txt <--- created third ...

DOS system path

Is there a way to programmatically, through a batch file (or powershell script), put all folders in c:\Program Files into the system variable PATH? I'm dependent on the command line and really want to just start a program from the command line. Yes, I'm jealous of Linux shells. ...

Date arithmetic in dos scripting

I need to write a script to change a filename from aDate.txt to bDate.txt where: aDate is the current system date in yyyymmdd format and bDate is the current system date - 1 in yyyymmdd format. I currently have: set yy=%date:~6,2% set mm=%date:~3,2% set dd=%date:~0,2% if "%date:~6,1%"==" " set yy=0%yy:~1,1% if "%date:~3,1%"==" " se...

How to read any text after = sign stored in a file.

I am working on some batch file. I need to read name from some text file. Let me explain it I have one file File.txt, which has entry like ”FirstName=John”. Now my batch file should read text ”John” from the file and I should be able store ”John” in some variable too. But with following code, If I use “delims==”,I can get ”FirstName” t...

Passing arguments with DOS wildcards to a Python script

I want to do something like this: c:\data\> python myscript.py *.csv and pass all of the .csv files in the directory to my python script (such that sys.argv contains file1.csv, file2.csv, etc.) But sys.argv just receives *.csv indicating that the wildcard was not expanded, so this doesn't work. I feel like there is a simple way to ...

ASM print over allready printed values

I have an ASM script that displays date(day, month, year) and time(hours, minutes, seconds). This prints the current datetime on the DOS-box. Thing is, it's static. What I want to do is make it dynamic, meaning I have to write the new value in the exact place where the current value is standing on the screen. How do you do this in ASM? ...

How do I make a bitwise and in a bat-file?

I have tried with the following, but it just says "& was unexpected at this time." @echo off :enter-input echo Please enter a number between 1 and 15: echo 1 = Selection one echo 2 = Selection two echo 4 = Selection three echo 8 = Selection four echo x = Quit set INPUT= set /P INPUT=Type number: %=% if "%INPUT%" == "" goto enter-input...

Running DOS games under Dosbox 0.72

Hi I am using Windows Vista and with Dosbox 0.72 to load Turbo C for programming a DOS game. My code runs fine (both graphics and sound routines) as long as it runs under DOS shell of Turbo C (Under Dosbox). But when I run the same code under DosBox (outside Turbo C's Dos shell), the graphics flickers, slows down and the sound cracks....

In Batch: Read only the filename from a variable with path and filename

I am currently looking for a way to take a variable in batch and only parse out the filename. For example, I pass my batch file a -s parameter from another application which is subsequently set to my source variable. The source file variable typically contains something like: C:\Program Files\myapp\Instance.1\Data\filetomove.ext. I ass...

Separating 'body' of domain name from extension - DOS shell

Hi, I tried everything possible, but still failed. I thought I got it at the point which I'll post as my final attempt, but still isn't good [enough]. A script is being passed three arguments. Domain name, username and password. But the probles is that I need domain separated in "domain" + ".com" format. Two variables. I tried to split...

dollar-terminated strings

In my assembly language class, our first assignment was to write a program to print out a simple dollar-terminated string in DOS. It looked something like this: BITS 32 global _main section .data msg db "Hello, world!", 13, 10, ’$’ section .text _main: mov ah, 9 mov edx, msg int 21h ret As I understand it, the $ sign serves...

Is there a DOS command for verifying what version of .NET is installed

I have set of scripts for doing scripted installs. You can use the scripts on any server 2008 machine. However, I need to check if .NET 3.5 has been installed (before the scripts run) using a dos batch file. Is that possible? I know I can check if a file in the C:\WINDOWS\Microsoft.NET\Framework\v3.5 exists, but it would be nice to...

How do I echo and send console output to a file in a bat script?

I have a batch script that executes a task and sends the output to a text file. Is there a way to have the output show on the console window as well? For Example: c:\Windows>dir > windows-dir.txt Is there a way to have the output of dir display in the console window as well as put it into the text file? Thanks ...

Is there a way in a batch script to keep the console open only if invoked from Windows Manager?

I have a DOS batch script that invokes a java application which interacts with the user through the console UI. For the sake of argument, let's call it runapp.bat and its contents be java com.example.myApp If the batch script is invoked in a console, everything works fine. However, if the script is invoked from the Window Manager, the...

Bash/DOS/PowerShell script to list most recent versions of files?

We have a list of (let's say 50) reports that get dumped into various folders depending on certain conditions. All the reports have standard names eg. D099C.LIS, D18A0.LIS etc. Sometimes a report can exist in up to 5 different locations, and I need to generate a list of all the locations of the most recent version of each report. I ca...

Command line to delete matching files and directories recursively

How can I recursively delete all files & directories that match a certain pattern? e.g. remove all the ".svn" directories and the files they contain? (Sadly DOS only) ...

Command line to recursively delete files but excluding a certain file

I need to delete files of a certain type (.zip files, say) from a folder, and all of its sub-folders, using the command line. Ideally I am looking for something that can be run as a .bat file in Windows. I know there is a /S switch for the DEL command to look in sub-folders, but to add to the challenge I need to exclude files of a cert...

Easiest way to add a text to the beginning of another text file in Command Line (Windows)

What is the easiest way to add a text to the beginning of another text file in Command Line (Windows)? ...

Tortoise SubWCRev.exe Pre-Build Event

Hi, I run the following command as a pre-Build event in Visual Studio 2005 and it works fine: SubWCRev.exe "C:\work\subversion\aviOffline .Net\trunk" "c:\test.tmpl" "c:\testout.txt"C:\work\subversion\aviOffline .Net\trunk" So I change the command to use the in-built Visual Studio macros for better maintainability but it fails. It ...