batch-file

How to FINDSTR seek an occurrence within a numerical range specified in all TXT in the directory?

不羁的心 提交于 2020-01-13 07:30:11
问题 How do I get "FINDSTR" find a value between a specified range ? I set the "string": "20141001" and "20141030" . If within the *.TXT file exists "20141017", should return the "ERRORLEVEL" = 0. EXEMPLE: @echo off SET DATE_STA=20141001 SET DATE_END=20141030 echo Looking for all the files in the folder echo within the range from %DATE_STA% to %DATA_END% ... echo. :FINDING findstr /r "%DATE_STA% to %DATA_END%" C:\Folder\*.txt IF %ERRORLEVEL%==0 ( goto OKAY) else ( goto FAIL ) :OKAY cls echo. echo

Execute shortcut links from a batch file and don't wait for application to exit

情到浓时终转凉″ 提交于 2020-01-12 18:51:14
问题 I have several applications that I tend to need open at the same time, and rather than relying solely on the Startup folder to launch them at the same time (and so I can reopen all of them if some were closed at some point throughout the day) I created a folder full of shortcuts in a similar fashion to Linux's runlevel startup links. So in the folder I have shortcut links similar to: S00 - Outlook.lnk S01 - Notepad++.lnk S02 - Chrome.lnk S03 - Skype.lnk I created a batch file that will loop

Start process as limited user from elevated script

て烟熏妆下的殇ゞ 提交于 2020-01-12 08:37:38
问题 I have an elevated console running some bat files. Having this console running in elevated mode is mandatory for it to be able to perform some tasks like managing network shares, etc without asking for permissions. But sometimes the scripts also have to launch some applications which are not desired to run elevated. So we want our elevated bats to start come application in non-elevated mode. Is there any built-in way to do this on Windows? Processes were started with DOS command START up to

stop gulp from changing shell/cmd title name

允我心安 提交于 2020-01-12 07:27:33
问题 When gulp is called the it changes my cmd (windows) title to: "gulp" I want the window name to stay as it was I know I can use https://www.npmjs.com/package/gulp-shell but this seems like an overkill I mean that if I call batch script title mytitle gulp . the window's title is "gulp" and not "mytitle" 回答1: Use process.title as stated in this issue : concat process.title instead of overwrite. You shoud use process.cwd() to get the directory where the gulpfile is running. somewhere in your

Batch File to execute all .exe in a folder

拜拜、爱过 提交于 2020-01-12 06:14:14
问题 I need to create a batch script that will run all .exe files in a folder. This must include subfolders. I am running windows 7, and the batch file is stored in the root folder I have tried several variations with no success. The two main variations are as follows REM dir *.exe /S /B > tmpFile REM set /p listVar= < tmpFile REM del tmpFile FOR %%F IN (%listVar%) DO %%F ======================================= FOR /F "usebackq" %%F IN ('dir *.exe /S /B') DO %%F I have looked through several

only do if day… batch file

本秂侑毒 提交于 2020-01-12 05:25:23
问题 hello i got a batch file, something like this: if %day%==monday, tuesday, wednesday, thursday, friday ( goto yes ) else ( goto no ) Now i know the first line won't work. What i actually want to happen: It automatticly checks which day it is. If it is Monday to Friday, it has to go to 'yes', otherwise (saturday/sunday) to 'no'. How to do this? 回答1: I ran across this online. Tested, and it works. Returns the day as an integer, which you can still work with. @For /F "tokens=2,3,4 delims=/ " %%A

Permanently altering a user's %PATH% environment variable via batch or Python

时间秒杀一切 提交于 2020-01-12 05:23:06
问题 I've been having difficulty with getting my users to set the PATH environment variable manually, I'm looking for a way to do this automatically. A batch file would be preferable, since that would require them to run it themselves (with a warning as to what they're doing), but an addition to the setup.py is acceptable as well. Other information: SET only affects the current and derivative shells; the permanent values seem to be stored in the Registry somewhere (a place where I dare not tread).

Opening/Closing application via .bat file [Windows]

隐身守侯 提交于 2020-01-12 05:09:46
问题 Good Day, I have a .bat file that run a specific application then after 5 seconds it will close/kill it. I having right now due to it successfully open the application thought when the app opens it will not execute the remaining commands unless I manually close the app. Here is my code: cd "C:\Program Files (x86)\Aspera\Point-to-Point\bin\" asperascp.exe sleep 5 taskkill /IM asperascp.exe /f I also try removing the sleep command. cd "C:\Program Files (x86)\Aspera\Point-to-Point\bin\"

Opening/Closing application via .bat file [Windows]

跟風遠走 提交于 2020-01-12 05:09:27
问题 Good Day, I have a .bat file that run a specific application then after 5 seconds it will close/kill it. I having right now due to it successfully open the application thought when the app opens it will not execute the remaining commands unless I manually close the app. Here is my code: cd "C:\Program Files (x86)\Aspera\Point-to-Point\bin\" asperascp.exe sleep 5 taskkill /IM asperascp.exe /f I also try removing the sleep command. cd "C:\Program Files (x86)\Aspera\Point-to-Point\bin\"

Get image file dimensions in .bat file

こ雲淡風輕ζ 提交于 2020-01-12 04:01:26
问题 I have a bat file that lists the paths of all images in a folder the code is @echo off break > infofile.txt for /f "delims=" %%F in ('dir /b /s *.bmp') do ( echo %%F 1 1 1 100 100 >>infofile.txt ) The text file looks like this C:\Users\Charles\Dropbox\trainer\temp\positive\rawdata\diags(1).bmp 1 1 1 100 100 C:\Users\Charles\Dropbox\trainer\temp\positive\rawdata\diags(348).bmp 1 1 1 100 100 C:\Users\Charles\Dropbox\trainer\temp\positive\rawdata\diags(353).bmp 1 1 1 100 100 What I want to do is