batch-file

Execution halts on “Microsoft Visual C++ Runtime Error”-popup

时光怂恿深爱的人放手 提交于 2020-01-24 11:27:45
问题 A project I am currently involved in uses JavaCv/OpenCv for face detection. Since the OpenCv occasionally throws an error, and the propagation of OpenCv/C++ errors to Java Exceptions isn't fully functional yet, this means the Java main-loop crashes with no way to recover. However, the code gives mostly accurate results, and since we're running it on a large database I baked a quick Batch-script around the execution to keep it going, and the Java code internally manages an id , to make sure it

A reliable way to check if two variables in a cmd shell point to the same folder

对着背影说爱祢 提交于 2020-01-24 10:13:43
问题 It can't be checked just by comparing these variables: C:\>set "d1=C:\" C:\>set "d2=C:\Windows\.." C:\>if %d1%==%d2% (echo true) else (echo false) false I can make up a sophisticated construct with pushd and popd and additional variables but isn't there a simpler way? 回答1: Similar to jeb's solution, but using FOR instead of called subroutine for %%A in ("%d1%") do for %%B in ("%d2%") do if "%%~fA"=="%%~fB" (echo true) else (echo false) 回答2: You could normalize the variables with a small

How to remove newlines from a text file with batch or PowerShell

左心房为你撑大大i 提交于 2020-01-24 07:49:14
问题 Essentially, I want to read from file.txt with contents apple banana carrot and write to newfile.txt so that it will have contents apple banana carrot I need to do this on a Windows computer on which I do not have install permissions. I tried set row= for /f %%x in (file.txt) do set row=%row% %%x echo row > newfile.txt and I tried using PowerShell statements (I cannot run PowerShell scripts) instead of the CMD-style for loop. powershell -Command "(Gc file.txt) | Foreach-Object -Process {set

Close a running application from DOS command line

烈酒焚心 提交于 2020-01-24 02:16:07
问题 The start command can launch an application like notepad in a batch file like this: start notepad start "my love.mp3" But how do I close the running application from the command line? I found taskkill in my searches but I don't think that is the right command because it's not working—it says no such file. How do I close an application launched with start ? 回答1: Taskkill is correct. But you must kill the process playing the file, not the file itself. Figuring out the registered handler for mp3

How to run three batch files in parallel and run another three batch files after finishing first set? [closed]

大憨熊 提交于 2020-01-24 02:14:29
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . I have around 24 batch files which I have to run 3 at a time and after finishing first 3 then I to have run next 3 files and so on. Suppose I have files like 1.bat,2.bat, 3.bat and so on I need them to run first 3 upon finishing first 3 files I need next 3 files to run and so on till all 24 files.

Automate file transfer activity from local machine to remote machine using WinSCP script

时间秒杀一切 提交于 2020-01-24 01:43:28
问题 I want to transfer file(s) in bulk (approx 50 files at a time) from my local machine to remote machine (Linux server) and I wanted to automate this activity using WinSCP. I already have generated code by doing manually in WinSCP. Saved the code and created batch file. But it is throwing error like The filename, directory name, or volume label syntax is incorrect The system cannot find the path specified. However the given destination and source are valid/correct. @echo "open sftp:/

Batch file to edit an .ini

本小妞迷上赌 提交于 2020-01-24 01:41:06
问题 I have a program for which a setting in the .ini file seems to constantly revert. I find myself constantly checking the file to see if it needs to be edited, so I would like to see if I can come up with a batch file that will do this job. The idea is to create this batch file to scan the .ini file every 2 minutes to check the value of a particular line and change the value if necessary. The line is: UpdateSpeedCore=8 8 is the desired number for the check, but it sometimes reverts to 100. The

Update a batch file from another batch file

送分小仙女□ 提交于 2020-01-24 00:32:09
问题 Dear StackOverFlow Members, Please help me with this batch file. I would like to use the answer given from the "SET /P INPUT=%=%" and have it update another batch file permanently. This is the first batch file that runs to get an answer from the user @echo off cls echo. echo ................................................................. echo ..... Specify what the name of the Store is, this will send ..... echo ............... alerts to abd@abc.co.za .............. echo ...................

Using WMIC in a batch file to uninstall a program

好久不见. 提交于 2020-01-23 16:22:58
问题 I am writing a script to uninstall a program. I am utilizing WMIC to do this. When I run the script, it stops immediately after the wMIC command is run. When run it manually everything works fine. My script looks like this: @echo off title Forcepoint DLP Endpoint Echo Forcepoint DLP Endpoint wmic product where name="Forcepoint DLP Endpoint" call uninstall /nointeractive What should I be added after "WMIC" in order to continue the script? This script when entered manually worked: wmic product

Using WMIC in a batch file to uninstall a program

醉酒当歌 提交于 2020-01-23 16:22:42
问题 I am writing a script to uninstall a program. I am utilizing WMIC to do this. When I run the script, it stops immediately after the wMIC command is run. When run it manually everything works fine. My script looks like this: @echo off title Forcepoint DLP Endpoint Echo Forcepoint DLP Endpoint wmic product where name="Forcepoint DLP Endpoint" call uninstall /nointeractive What should I be added after "WMIC" in order to continue the script? This script when entered manually worked: wmic product