batch-file

Get specific string from a text file using batch command [closed]

佐手、 提交于 2020-01-17 15:16:40
问题 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 looking for a Windows batch script command that can extract specific data string from an automatically generated text file. Note that the first line in the test.txt file is always empty. I need to extract only " 2017/01/01-01 " (from the 2nd line) to a different file. Findstr

Get specific string from a text file using batch command [closed]

对着背影说爱祢 提交于 2020-01-17 15:16:07
问题 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 looking for a Windows batch script command that can extract specific data string from an automatically generated text file. Note that the first line in the test.txt file is always empty. I need to extract only " 2017/01/01-01 " (from the 2nd line) to a different file. Findstr

How to properly make a loop with a list of URLS from a CSV file (BAT file)

坚强是说给别人听的谎言 提交于 2020-01-17 15:09:53
问题 I need to load a list of URLs from a CSV file to a BAT file and make it go to each one of those URLs, then close it and go to the next one. I know it is possible, but the other threads I found are too complicated and I don't know where I need to save the CSV file. This is the code I've already written: start chrome https://www.google.co.in/ timeout 5 taskkill /f /im chrome.exe I need a code that goes to 500 URLs. Can you show an example of how I go to each one of those in the code? (or how I

Batch script to find a regex in a text file and write it line by line in another text file

纵然是瞬间 提交于 2020-01-17 12:26:33
问题 My text file accommodates these lines: Successfully started load asymmetric-song-851:bqjob_r069b9290_0000014bfebbdfa9_1 Successfully started load asymmetric-song-851:bqjob_r76eb714e_0000014bfebbf0de_1 BigQuery error in load operation: Error processing job 'asymmetric-song-851:bqjob_r7853a02a_0000014bfebc0247_1': Not found: URI gs://brillio_buck/Week/game_activity_android_2015-01-23_to_2015-01-25.tsv Some random text ...,,,, Some other random text Successfully started load asymmetric-song-851

How to automatically move and click mouse key using at least batch files?

杀马特。学长 韩版系。学妹 提交于 2020-01-17 11:08:18
问题 I learned recently I could use batch files and JavaScript to send to keyboard presses and movements to the interface I am currently using. (See this question for one of the problems I solved using the information from this question.) However, I am not an experienced JavaScript or any other language user yet I am proficient in writing the general basic language. While I know there are many JavaScripts, heck even other languages, that allow you to create mouse movement and clicks (see here for

How to automatically move and click mouse key using at least batch files?

坚强是说给别人听的谎言 提交于 2020-01-17 11:07:26
问题 I learned recently I could use batch files and JavaScript to send to keyboard presses and movements to the interface I am currently using. (See this question for one of the problems I solved using the information from this question.) However, I am not an experienced JavaScript or any other language user yet I am proficient in writing the general basic language. While I know there are many JavaScripts, heck even other languages, that allow you to create mouse movement and clicks (see here for

Modify for loop to not use delayedexpansion in batch script

偶尔善良 提交于 2020-01-17 10:54:10
问题 In my efforts to understand the for..do loops syntax and their use of %% variables. I have gone through 2 specific examples/implementations where the one for loop does not use DELAYEDEXPANSION and another where it does use DELAYEDEXPANSION with the ! notation. The 1st for loop appears to be compatible with older OSs like the Windows XP whereas the 2nd for loop example does not. Specifically, the 1st for loop example is taken from this answer (which is related to this) and the 2nd for loop

Excluding a directory in for loop's search

风格不统一 提交于 2020-01-17 10:17:13
问题 I have the following line of code: FOR /R D:\1_FOLDER %f IN (*.jpg,*.png) DO XCOPY %f D:\2_FOLDER /H /C The first problem what i have, the command doesn't run, i get the error Invalid numbers of parametres The second problem in directory 1_FOLDER i have 2 more folders X_FOLDER and Y_FOLDER, i want the for loop to search only in X_FOLDER, and copy only files of the X_FOLDER. I have the second problem same when i want to copy from C:\ , i want to exclude the Windows folder from for loop's

Excluding a directory in for loop's search

五迷三道 提交于 2020-01-17 10:17:09
问题 I have the following line of code: FOR /R D:\1_FOLDER %f IN (*.jpg,*.png) DO XCOPY %f D:\2_FOLDER /H /C The first problem what i have, the command doesn't run, i get the error Invalid numbers of parametres The second problem in directory 1_FOLDER i have 2 more folders X_FOLDER and Y_FOLDER, i want the for loop to search only in X_FOLDER, and copy only files of the X_FOLDER. I have the second problem same when i want to copy from C:\ , i want to exclude the Windows folder from for loop's

Stop batch file only processing last file?

允我心安 提交于 2020-01-17 09:33:21
问题 I have the following simple batch file for renaming *.txt files and removing the first x characters @Echo Off for %%i in ("*.txt") do ( set fname=%%i echo %fname% copy %fname% %fname:~9% ) However, it only processes the last file? If I have 4 files in there, the last file gets copied 4 times as well? What do I need to do? 回答1: The problem is that %var% is replaced by the variable's value when the loop is first parsed, and doesn't change during execution. Here's a demonstration which should