batch-file

batch script - write all files found in one directory into one command line?

两盒软妹~` 提交于 2021-02-10 15:00:26
问题 I have a directory with a bunch of files with a mix of extension. I only want to work with files with extension *.abc. Each *.abc file should then be handed over to another software with some parameters. The parameters are always the same for each file. One of the parameters needs to be defined by the user, though. So my first try was this: @ECHO OFF set /p value="Enter required imput value: " for %%f in (*.abc) do ( START C:\"Program Files"\Software\startsoftware.exe -parameter1 "%%~nf.abc"

DOS Multiline batch command. How to add comments between arguments?

左心房为你撑大大i 提交于 2021-02-10 12:02:03
问题 Id like to add comments like this: makecert -r ^ // This means SelfSigned -pe ^ // Private key is exportable -a sha512 ^ // The algoritm ... Is this possible? How? 回答1: Nothing official, but there is a simple and very effective hack - use undefined variables. At least one = is added to guarantee that the content cannot be a valid variable name, since the character cannot be used in a variable name. I use one at the beginning and end just for symmetry. Also, the comment cannot contain % or : .

DOS Multiline batch command. How to add comments between arguments?

折月煮酒 提交于 2021-02-10 12:01:52
问题 Id like to add comments like this: makecert -r ^ // This means SelfSigned -pe ^ // Private key is exportable -a sha512 ^ // The algoritm ... Is this possible? How? 回答1: Nothing official, but there is a simple and very effective hack - use undefined variables. At least one = is added to guarantee that the content cannot be a valid variable name, since the character cannot be used in a variable name. I use one at the beginning and end just for symmetry. Also, the comment cannot contain % or : .

DOS Multiline batch command. How to add comments between arguments?

你。 提交于 2021-02-10 12:01:23
问题 Id like to add comments like this: makecert -r ^ // This means SelfSigned -pe ^ // Private key is exportable -a sha512 ^ // The algoritm ... Is this possible? How? 回答1: Nothing official, but there is a simple and very effective hack - use undefined variables. At least one = is added to guarantee that the content cannot be a valid variable name, since the character cannot be used in a variable name. I use one at the beginning and end just for symmetry. Also, the comment cannot contain % or : .

How to delete lines 1, and 3 to 19 in a .csv file?

倾然丶 夕夏残阳落幕 提交于 2021-02-10 10:09:11
问题 I'd like to delete lines 1 and 3 to 19 of a csv file. I am able to delete all the 19 lines but not able to preserve the line I need (2nd line) By using other posts, my script looks like the following @echo off set "csv=test.csv" more +1 "%csv%" >"%csv%.new" move /y "%csv%.new" "%csv%" >nul ----missing instruction --- more +17 "%csv%" >"%csv%.new" move /y "%csv%.new" "%csv%" >nul So I delete the first line (then my desired line is now at the top), and I'd like to delete 17 lines starting in

How to compress all files with exception of newest file in each subfolder of a folder into one ZIP file per subfolder?

醉酒当歌 提交于 2021-02-10 05:20:10
问题 I'm trying to create a batch script that will zip all the contents in each subdirectory except the latest (or latest few). I'm currently attempting in Windows with 7-Zip but the directory is technically on a Linux server so any suggestions geared towards a Linux command is welcome. The directory structure is like this: Directory-Parent ---Sub-Directory-1 --------File1 --------File2 --------File3 ---Sub-Directory-2 --------File1 --------File2 I would like to run a batch at the Directory-Parent

“error: can't find main class scala.tools.nsc.MainGenericRunner” when running scala in windows

江枫思渺然 提交于 2021-02-09 12:01:15
问题 after downloaded scala 2.10.2 for windows, and run scala I met such error: "错误: 找不到或无法加载主类 scala.tools.nsc.MainGenericRunner" which means "error: can't find or load main class scala.tools.nsc.MainGenericRunner". So I check the scala.bat for reasons, and I found such function: :set_home set _BIN_DIR= for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi echo in set_home: %_BIN_DIR% set _SCALA_HOME=%_BIN_DIR%.. goto :eof After this function the _SCALA_HOME become D:\program files\scala\files

Multiple new browser windows from batch file

妖精的绣舞 提交于 2021-02-09 06:58:35
问题 I have read through many threads here relating to my issue. My problem seems simple, but I cant find the final piece, or I'm just overlooking something obvious. I have found multiple answers, but none that I can get to work. I am simply trying to open 4 new Chrome windows, not tabs. I am almost there. What I am using will in fact open each one up and size and position it. But it is requiring me to close one down before the next one will start. @echo off "C:\Program Files (x86)\Google\Chrome

Multiple new browser windows from batch file

情到浓时终转凉″ 提交于 2021-02-09 06:56:15
问题 I have read through many threads here relating to my issue. My problem seems simple, but I cant find the final piece, or I'm just overlooking something obvious. I have found multiple answers, but none that I can get to work. I am simply trying to open 4 new Chrome windows, not tabs. I am almost there. What I am using will in fact open each one up and size and position it. But it is requiring me to close one down before the next one will start. @echo off "C:\Program Files (x86)\Google\Chrome

Force batch file to load to RAM before running

China☆狼群 提交于 2021-02-08 15:11:56
问题 I have a batch file in an administrative partition of my portable drive, with a shortcut symlinked to it on the root of the drive. The purpose of the file is to unmount the drive and remount it as the specified letter (mostly for convenience). When the file is opened, it is opened relative to the current letter rather than to the volume ID, so naturally, when the unmount happens, the command processor has no idea what to do next as it reads the file as needed rather than caching it. There are