batch-file

Search XML files in directory for specific string then do copy action using bat script

廉价感情. 提交于 2020-01-07 03:35:09
问题 I'm new to batch scripts so I would appreciate commented solution if possible. I'm looking for a bat script that would search set directory c:\in containing XML files for files that contain "xyz" string (in them, not in their filename). Once the file with "xyz" is found it should be copied to another location c:\out . For illustration purposes all of XML files have the same structure and the string (that files should be search for) is within the tag . 回答1: @ECHO OFF SETLOCAL SET "sourcedir=U:

batch file with relative path and close command prompt

会有一股神秘感。 提交于 2020-01-07 03:13:25
问题 I try this code : start /d "D:\test\CONTOH\DATA\QGIS2\bin\" qgis.bat based on : Bat file to run a .exe at the command prompt But, I want to be relative path, something like this : start /d %~dp0\DATA\QGIS2\bin\qgis.bat based on : relative path in BAT script but, nothing happen. So, can someone give me information, what is wrong? 回答1: Open a command prompt window and run start /? . This outputs the help for the command START which should be read on using this command to get knowledge about its

Batch- If statements based on files/websites open

◇◆丶佛笑我妖孽 提交于 2020-01-07 03:03:20
问题 In my previous question, Batch if statements based on opening a program, I asked how to make a batch if statement based on opening a program. Can I make a batch-file IF statement based off: File Paths in explorer: e.g. "C:\USERS\admin\desktop\" Files: e.g. "James.csv" Websites: e.g. "http://www.google.com" To make my question a bit clearer: @echo off Set WinProcess1=D:\PFI.vbs Set WinProcess2=c:\ Set WinProcess3=http://www.google.com :props tasklist /FI "IMAGENAME eq %WinProcess1%" | find /C

Batch file to split text file into multiple files in same directory on Win Svr 2012 using NO 3rd Party Apps [closed]

安稳与你 提交于 2020-01-07 02:51:27
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I am hoping the wonderful experts here can assist me with my problem. I have found this site extremely useful in the past in solving other issues I have had but I have searched this site and tried all the answers similar to my problem but cant seem to get any of them to work for

getting server details in output csv file using batch script

家住魔仙堡 提交于 2020-01-07 02:24:43
问题 Below code gets the xml data output for each of the servers which is listed in serverFile file and gets the required tag values in csv format as output with required tag name as header. Am trying to achieve below requirement to make code more generic/output format readable ie, a. make the ipaddress parameterised so, can use server_variable in wget line and in turn this can be run for all the servers which is present in serverFile .\bin\wget64.exe -OC:\output.xml http://11.12.13.15/xmldata?get

getting server details in output csv file using batch script

大城市里の小女人 提交于 2020-01-07 02:24:08
问题 Below code gets the xml data output for each of the servers which is listed in serverFile file and gets the required tag values in csv format as output with required tag name as header. Am trying to achieve below requirement to make code more generic/output format readable ie, a. make the ipaddress parameterised so, can use server_variable in wget line and in turn this can be run for all the servers which is present in serverFile .\bin\wget64.exe -OC:\output.xml http://11.12.13.15/xmldata?get

Batch files compare numbers

喜欢而已 提交于 2020-01-07 02:12:48
问题 I have to write a script that check if there is enough space in the drive. I wrote the following: @echo off set gbsize = 1,073,741,824 Set gbsize=%gbsize:,=% for /f "tokens=3" %%a in ('dir c:\') do ( set /a bytesfree=%%a ) set bytesfree=%bytesfree:,=% endlocal && set bytesfree=%bytesfree% If %gbsize% gtr %bytesfree% echo hi but when the script thrown error: Invalid number. Numeric constants are either decimal (17), hexadecimal (0x11), or octal (021). what did I miss? can anyone help? thanks!

Batch-Loop that opens fixed length filenames in subdirectories

回眸只為那壹抹淺笑 提交于 2020-01-07 02:01:31
问题 I got this far into making a code (with you guys help on here) but it doesn't do what it's supposed to do.. The goal of the batch is to open all K_E*.dwg files and execute a script on those. The length of the K_E*.dwg files should be 9. Example K_E123456.dwg. So far, this code opens a dos-window and closes it again.. my folders structure is like this : C:\Users\b00m49\Desktop\LSPTEST\0031\00\K_E000031.dwg C:\Users\b00m49\Desktop\LSPTEST\0031\01\K_E010031.dwg C:\Users\b00m49\Desktop\LSPTEST

Using BATCH to clean up file names to name full path

狂风中的少年 提交于 2020-01-07 01:22:42
问题 All the information is located in a text file. I would like to go from this: /var/www/xxx/video_folder_1: New folder New folder - Copy New folder - Copy (10) New folder - Copy (10) - Copy New folder - Copy (10) - Copy - Copy New folder - Copy (11) /var/www/xxx/video_folder_2: cideo.mp4 sadasd To this: /var/www/xxx/video_folder_1/New folder /var/www/xxx/video_folder_1/New folder - Copy /var/www/xxx/video_folder_1/New folder - Copy (10) /var/www/xxx/video_folder_1/New folder - Copy (10) - Copy

Batch File compare 3 Strings in a row, multiple strings

淺唱寂寞╮ 提交于 2020-01-06 23:45:27
问题 I want to check a condition, if two files' modified dates have been updated to system's date, then trigger something. My code works, except %DATEONLY%==%SystemDate%==%ZipONLY% , this part has some issue, what is the right format for compare 3 Strings in Batch? or is there a way to separate them? Thanks ALL!! @ECHO OFF FOR /f "tokens=1,2,3,4 delims=. " %%i in ('date /t') do set SystemDate=%%k%%j echo %SystemDate% is System Date pause FOR %%a IN (D:\MyFile.txt) DO SET FileDate=%%~ta set