dos

create batch file to copy folder contents with dynamic name

对着背影说爱祢 提交于 2020-01-02 08:55:09
问题 I am absolutely brand new to any kind of development but need a batch job to copy a file from one folder to another. The problem is that the source folder is dynamically named. The folder name will contain the current date and a suffix number (eg. "TestRun_20141106_13") - so I will never be able to determine the 'latest' version of the folder before running the batch / copy job. Can anyone help please? I know this will be easy for someone but as I said, I am a complete noob!! Thanks in

.bat file to create a complex string variable with special characters

故事扮演 提交于 2020-01-02 03:47:09
问题 I need to create a single string variable by concatenating multiple strings. The final string i need is as below <Workspace name="RealTimeRiskUSD_UA" path="C:\workspace" IsAdmin="false" /> This is what i tried. echo off set path1="<Workspace " set name="name="RealTimeRiskUSD_UA"" set path2="path="C:\workspace" IsAdmin="false" />" set fullpath=%path1%%name%%path2% echo %path1% echo %name% echo %path2% echo %fullpath% I also tried using the below link to remove the double quotes from each

Run Batch file as administrator - Windows 7 - Command “Run As” from network file system

六眼飞鱼酱① 提交于 2020-01-02 02:53:07
问题 I need to set up the delivery of a program installer. This program has a program_installer.exe and a folder that i cannot include in the installer at the time in which i create the installer. therefore, when a user needs to install the program i send him a BATCH file via MAIL @echo off if DEFINED PROGRAMFILES(X86) ( SET TOOL_INSTALL_DIR="%PROGRAMFILES(X86)%\myfolder" ) else ( SET TOOL_INSTALL_DIR="%PROGRAMFILES%\myfolder" ) MKDIR %TOOL_INSTALL_DIR% copy /y \\rk0012352\Public\lkh5iwwh.m4s

Win7(64位)安装Microsoft SQL Server Management Studio Express[error 29506]

a 夏天 提交于 2020-01-01 18:10:40
本文转载自: https://www.cnblogs.com/over140/archive/2010/01/12/1644513.html 作者:over140 转载请注明该声明。 前言   关键字:SQLServer2005_SSMSEE_x64 error 29506   新买电脑,配了4G内存,一狠心就给装了64位的Win7,吃螃蟹了 - - # ,暂时没太多问题,摄像头的驱动用不了,然后装了个VMware7算是凑活用了。今天装数据库才发现2000装不了,2005能装,但是 Management Studio装了不,下了个64位的也装不了,于是借助翻译工具和GOOGLE总是是找到了解决方案,权当是翻译吧。 文章   1.  Microsoft SQL Server Management Studio Express      下载地址:http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796   2.  解决方案原文地址      http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/3a8b79a2-9258-464f-bdb8

Shutdown computer in MS-DOS using ACPI

本小妞迷上赌 提交于 2020-01-01 09:37:11
问题 I have MS-DOS 6.22 running on a Pentium based computer (motherboard supports ACPI), and would like to know if there was an assembly language routine I could use to shut down the computer, or is it a little harder than that (i.e. motherboard specific)? Basically, I want to create a small program to shut down the computer from the command line. 回答1: Here is an example of a tool written specifically for this: http://www.plop.at/en/dostoolsdl.html The source code can be found here: http:/

Passing a multi-line string as an argument to a script in Windows

∥☆過路亽.° 提交于 2020-01-01 05:14:13
问题 I have a simple python script like so: import sys lines = sys.argv[1] for line in lines.splitlines(): print line I want to call it from the command line (or a .bat file) but the first argument may (and probably will) be a string with multiple lines in it. How does one do this? Of course, this works: import sys lines = """This is a string It has multiple lines there are three total""" for line in lines.splitlines(): print line But I need to be able to process an argument line-by-line. EDIT:

Move all files except some (file pattern) from a DOS command

早过忘川 提交于 2020-01-01 04:50:09
问题 From a DOS command I want to move all files that do not match a file name pattern. Something like this: For example I want to move all files that do not start with "aaa" for %i in (*) do if not %i == aaa* move %i .\.. 回答1: XCOPY is designed to work with ' exclude ' lists... See below: dir /b /a-d "source"|findstr /b "aaa" >"%temp%\aaafiles.tmp" xcopy "source" "destination\" /exclude:%temp%\aaafiles.tmp /y The first line performs a DIR (directory) listing of the source folder, listing files in

search given set of file names.* in all sub directories and copy to another directory

ぃ、小莉子 提交于 2019-12-31 07:28:05
问题 I need extension to this question: search given set of files and copy to another directory There is a given set of file names in a needToFind.txt file such as: myImage1 , theImage, parisImage (one file name per line) And there is a folder named /MyImageFolder, which contains lets say 1000 images in its subfolders and itself, and also contains myImage1.jpg ,myImage1.png, theImage.jpg, parisImage.jpg, parisImage.png,parisImage.tiff I want to find those given image names without looking file

DataInputStream和DataOutputStream

最后都变了- 提交于 2019-12-31 03:41:13
DataOutputStream 数据输出流允许应用程序以适当方式将基本 Java 数据类型写入输出流中。然后应用程序可以使用数据输入流将数据读入。 DataOutputStream 数据输入流允许应用程序以与机器无关方式从底层输入流中读取基本 Java 数据类型。应用程序可以使用数据输出流写入稍后由数据输入流读取的数据。对于多线程访问不一定是安全的。 线程安全是可选的,它由此类方法的使用者负责。 /** * 必须先使用DataOutputStream写入数据,然后使用DataInputStream读取数据方可。 * * @author 徐越 * */ public class TestClass { public static void main(String[] args) throws Exception { TestClass t = new TestClass(); t.write(); t.read(); } public void write() throws Exception { String path = this.getClass().getClassLoader().getResource("test.txt").toURI().getPath(); OutputStream os = new FileOutputStream(path);

MS-DOS how to get output of command as variable

♀尐吖头ヾ 提交于 2019-12-31 03:16:10
问题 I've written a program that returns keycodes as integers for DOS but i don't know how to get it's output as a variable. Note: I'm using MS-DOS 7 / Windows 98, so i can't use FOR /F or SET /P Does anyone know how i could do that? 回答1: A few solutions are described by Eric Pement here. However, for older versions of cmd the author was forced to use external tools. For example, program tools like STRINGS by Douglas Boling, allows for following code: echo Greetings! | STRINGS hi=ASK # puts