cmd

cmd line rename file with date and time

∥☆過路亽.° 提交于 2020-01-09 18:22:05
问题 Project moving forwards, I can see why creating .bat files to do things can become addictive! I can now save somefile.txt at regular intervals, I then rename somefile.txt by adding the time and date to create a unique file name ren somefile.txt somefile_%time:~0,2%%time:~3,2%-%date:~-10,2%%date:~3,2%%date:~-4,4%.txt As an example, the code above has just renamed somefile.txt to somefile_1317_13022011.txt (1317hrs on 13th February 2011) I ran ren somefile.txt somefile_%time:~0,2%%time:~3,2%-

cmd line rename file with date and time

十年热恋 提交于 2020-01-09 18:21:14
问题 Project moving forwards, I can see why creating .bat files to do things can become addictive! I can now save somefile.txt at regular intervals, I then rename somefile.txt by adding the time and date to create a unique file name ren somefile.txt somefile_%time:~0,2%%time:~3,2%-%date:~-10,2%%date:~3,2%%date:~-4,4%.txt As an example, the code above has just renamed somefile.txt to somefile_1317_13022011.txt (1317hrs on 13th February 2011) I ran ren somefile.txt somefile_%time:~0,2%%time:~3,2%-

Android: keytool error on the command line when locating debug.keystore

橙三吉。 提交于 2020-01-09 10:53:53
问题 I'm trying to generate the MD5 fingerprint from the debug.keystore file using keytool.exe in my JDK so I can use Google Maps in my Android project. I've located the keystore file and have moved it into C:\android just to make things easier. Then in a command prompt I type c:\Program Files\Java\jdk1.5.0_13\bin>keytool -list -alias androiddebugkey -keystore "C:\android\debug.keystore" -storepass android -keypass android And I keep getting the error: keytool error: java.lang.Exception: Keystore

Restore default working dir if bat file is terminated abruptly

。_饼干妹妹 提交于 2020-01-09 07:55:06
问题 I have a scenario where during execution of a batch file, it navigates to a different folder (say to "../asdf"); and at the end of execution it will set the current working dir as the same folder from where the user called the .bat file. But if the user terminates the batch processing before it is complete, the cmd show the current working dir (say "../asdf"). But in my case, I need to restore the working dir to the default/predefined one. Is it possible? Batch file is written by me, so I can

WaitForExit() Runtime Exception. (Waiting for cmd process to finish)

不羁岁月 提交于 2020-01-07 08:50:09
问题 Can you kindly tell me why I am getting a runtime exception when trying to run this code? Sub BtnNowClick(sender As Object, e As EventArgs) Dim myProcess As New Process Dim processFile As String = dlgFolder.SelectedPath Dim pyLocationDel As String = Path.Combine(dlgFolder.SelectedPath, "pdfmerge.py") Directory.SetCurrentDirectory(dlgFolder.SelectedPath) myProcess.Start(pyLocationDel) myProcess.WaitForExit() System.IO.File.Delete(pyLocationDel) End Sub Basically, what I want, is to detect for

How to add batch script to context menu of multiple computers

余生长醉 提交于 2020-01-07 07:56:27
问题 I've been trying to setup a batch script that can be run from the context menu inside a folder. The purpose of the batch script is to populate the folder with a predetermined folder structure. This will need to be replicated on multiple computers(Windows 7-10), so my idea was to have a network share with two batch files and one .reg file. One of the batch files labeled "install.cmd" would copy the other batch file labeled "Subfolders.cmd" to a folder on the C drive, and run the .reg file to

Storing large file within batch file

被刻印的时光 ゝ 提交于 2020-01-07 07:49:23
问题 I'm trying to create a batch file that stores one or more large files within it as base64 encoded strings, then converts them back into files. I've been following the first answer on this question: Store a file inside of a batch file? but i'm trying to store a ~3mb file within this batch file, and when it comes to writing the files source back to a file (via echo), the batch file appears to crash. I get a popup saying 'Windows Command Processor has stopped working'. Is there a limit to how

Recursive while loop in docker cmd

自作多情 提交于 2020-01-07 06:54:18
问题 I'm trying to run google chrome inside docker containers. I have been able to successfully do so, however there have been instances where chrome would not run on some of the containers (mass creation of containers). So I'm looking to run a while loop till the chrome process is found to be running. I've tried the following but with errors like "bash: [if: command not found" var chrome_command = 'google-chrome --user-data-dir=/home/ubuntu/chrome-user-dir'; var cmd = ''; cmd += 'Xvfb :99 & ';

Command Prompt Search for files in a directory take the name of one random

我们两清 提交于 2020-01-07 06:54:08
问题 Inside a directory c:\configs I have files with various extensions including the extension .rac. I need a script for the Windows command prompt that looks inside c:\configs for the names of the files that end with the extension .rac, ignoring other extensions. Then of all the names that end with .rac extension the script must choose a random one and process it with the command c:\programs\submit.exe namerandom.rac . For example, suppose that random .rac file is called mosaic.rac , then the

Close multiple profiles of firefox using CMD

北城以北 提交于 2020-01-07 06:35:51
问题 I want to close different profiles of firefox using command prompt. I have used taskkill /IM firefox.exe But this closes all the profiles. As I can open default profile using firefox.exe -p "default" -no-remote in cmd. Is there anyway to close multiple profiles ??? Please note--I don't wanna use PIDs 回答1: Short answer: No, not with Firefox's built-in capabilities. Long answer: Maybe, given you find or write a proper tool. Such a tool could either inspect the process command line and parse out