batch-file

Batch .txt processing with multiple columns [closed]

落爺英雄遲暮 提交于 2020-06-07 06:12:24
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 11 days ago . I have a little problem, I would like to edit data with the following batch script. @echo off set "txt=C:\Users\Desktop\test-batch\input.txt" set "temp=C:\Users\Desktop\test-batch\output.txt" for /f "tokens=1-43 delims=; " %%a in (%txt%) do echo %%a;%%ac;%%ad;%%ae;%%af;%%ag;%%ah;%%ai;%%aj;%%ak;%%al;%

Batch .txt processing with multiple columns [closed]

佐手、 提交于 2020-06-07 06:12:13
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 11 days ago . I have a little problem, I would like to edit data with the following batch script. @echo off set "txt=C:\Users\Desktop\test-batch\input.txt" set "temp=C:\Users\Desktop\test-batch\output.txt" for /f "tokens=1-43 delims=; " %%a in (%txt%) do echo %%a;%%ac;%%ad;%%ae;%%af;%%ag;%%ah;%%ai;%%aj;%%ak;%%al;%

Syntax error in one of two almost-identical batch scripts: “)” cannot be processed syntactically here

拥有回忆 提交于 2020-06-07 05:29:45
问题 I am trying to set up a Jenkins server for automatic Unity builds. Therefore I have written two (in my eyes) basically identical batch scripts. Both scripts are run as build steps by Jenkins via an Execute Windows batch command step using Command: E:\unityImport.bat and after that a second Execute Windows batch command step using Command: E:\unityBuild.bat They both have the same beginning as I need to gather some file paths and in particular the project's unity version. So in both scripts I

Windows CMD Batch Script - how to avoid cutting the mark “!” in the loop

五迷三道 提交于 2020-06-01 07:41:08
问题 I have XML file myConfig.xml. <?xml version="1.0" encoding="UTF-8" standalone="no"?> <test1.test.com id="valueTest1"/> <test2.test.com id="valueTest1"/> <test3.test.com id="valueTest1"/> <installpath>C:\Temp\TESTxyz</installpath> <userInput> <entry key="myPassword" value="Qwerty123!"/> <entry key="myLogin" value="John"/> </userInput> I need in CMD in batch script change value in . @echo off setlocal EnableDelayedExpansion set newValueInstallpath="D:\Work" (for /F "delims=" %%a in (myConfig

Batch File- Delete Folder contents and the parent folder

社会主义新天地 提交于 2020-06-01 04:46:09
问题 I make the following directory at the beginning of my BATCH FILE to store temporary content: "%userprofile%\Downloads\VersionCheckWillDelete" I wish to remove this folder and all of its contents. The following removes only the data in the folder but not the folder itself: RD /S /Q "%userprofile%\Downloads\VersionCheckWillDelete" EDIT: Turns out that it isn't deleting it because the BATCH file is still using it. I have considered POWERSHELL being still open and trying to kill it but it isn't

Java - Execute External Windows Applications?

£可爱£侵袭症+ 提交于 2020-06-01 01:51:29
问题 I'm unsure how to start an external application ( specifically on Windows ) through Java code. I'm not planning on using this Java code for Mac/Linux , so let's focus on the Windows code. What I've Done I've been researching this question for the last two days, and I still have not found an answer. I easily found the Runtime.getRuntime().exec() method, but the thing is I cannot find information on launching a Batch (.bat) file from my local workspace in IntelliJ Idea . What I'm Asking I would

Executing shell commands in parallel but limiting jobs (Windows without Cygwin)

£可爱£侵袭症+ 提交于 2020-05-30 08:23:37
问题 Here is what I am trying to do. Suppose I have a program called myprogram.exe , which I have to execute 1000 times. Under Windows, I could usually do something as simple as: for /L %n in (1,1,1000) do start /myfolder/myprogram.exe However, suppose I only have 5 CPU threads I can devote to running the 1000 instances of myprogram.exe , such that I launch only 5, then when one of these finishes another one is launched, etc until the whole 1000 end. Under Linux and using GNU Parallel, I could

Windows batch file - start git bash and run git commands

大憨熊 提交于 2020-05-28 07:19:05
问题 I am on windows-10. I want to create a batch-file to automate: Starting Git Bash in project folder Running the following Git commands: eval $(ssh-agent -s) ssh-add ~/.ssh/github_rsa git remote add origin git@github.com:git_user_name/git_repository_name.git My current batch file below successfully starts Git Bash in the project folder, but I have not found anything which helps me learn how to run the git commands. @echo off cd /d C:\project_folder start "" "%PROGRAMFILES%\Git\bin\sh.exe" -

Windows batch file - start git bash and run git commands

偶尔善良 提交于 2020-05-28 07:18:31
问题 I am on windows-10. I want to create a batch-file to automate: Starting Git Bash in project folder Running the following Git commands: eval $(ssh-agent -s) ssh-add ~/.ssh/github_rsa git remote add origin git@github.com:git_user_name/git_repository_name.git My current batch file below successfully starts Git Bash in the project folder, but I have not found anything which helps me learn how to run the git commands. @echo off cd /d C:\project_folder start "" "%PROGRAMFILES%\Git\bin\sh.exe" -

Copy file to destination folder and keep duplicates

不羁岁月 提交于 2020-05-28 05:30:26
问题 How do I copy a certain file to a destination folder that already has the same file with the same name, keep both files. For eg. if a.jpg is already present in the destination folder (assume one in number), now there would two files with different names (eg. a.jpg and a(1).jpg 回答1: We can also use TIMESTAMP: @echo off for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" set