batch-file

Easy way to compile, sign, zipalign APK for Android Play Store (Also SHA1 Key Viewer)

最后都变了- 提交于 2020-01-23 13:58:08
问题 How do you easily compile and deploy your APK packages to the Google Play Store? i have been searching around for the easiest way i could find for my setup and ended up doing the following below? Would you suggest a better way for this? "Can you sign and zip align your APK file from within Android Studio using a GUI, not by using the terminal?" Two Batch Files to assist with your deployment process The following batch file i created to speed up the testing of my APK files across various

Enabling IIS AutoStart and StartMode through scripting

六月ゝ 毕业季﹏ 提交于 2020-01-23 13:34:45
问题 I really want to enable these IIS settings in a startup script. An answer for doing this in code exists here: AutoStart a WCF on Azure WebRole. I dislike putting that sort of IIS tweaking in code. So I found these commands: %windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.autoStart:true %windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.startMode:AlwaysRunning They appear to be exactly what I want

7z “Incorrect command line” when I run the script in a different drive than C:

醉酒当歌 提交于 2020-01-23 12:26:06
问题 I'm doing a batch script so I can compress multiple directories inside a specific folder. The thing is it works perfectly if the folder is at C:\something, but if I try to do the same to a folder in i.e E:\something, I get an error. The script is this: @ECHO OFF if %1.==. ( SET "rootpath=%cd%" ) else ( SET "rootpath=%~1" ) FOR /D %%D IN ("%rootpath%\*") DO ( 7za a -t7z %%D.7z %%D\* -mx9 ) Example of how it works normally: C:\Users\Me\Desktop\ExampleFolder>script 7-Zip (A) 9.20 Copyright (c)

How to check if current drive is on a local disk (cmd)?

醉酒当歌 提交于 2020-01-23 11:49:09
问题 To get the drive the current batch resides in is easy using set batchdrive=%~d0 But how is it possible to check if %batchdrive% is on a local drive and not on a (mapped) network share? Checking for %SYSTEMDRIVE% or a fixed list "C:" "D:" ... is not reliable. 回答1: To check whether a drive ( %~d0 ) is a local one, you could use a wmic query: wmic LogicalDisk where(DeviceID="%~d0" AND DriveType=3) get Description,DeviceID,DriveType Given that %~d0 expands to the local drive C: , the output looks

Is it possible to output the current color code on the command prompt using batch programming?

好久不见. 提交于 2020-01-23 09:25:56
问题 I am making a tutorial program for a friend of mine using batching programming. I would like to know if it is possible if there is code I can write in the file that will display the current color code. Example being the color is currently set to 0A and I want be displayed on the line saying: echo The color is currently set to 0A . I want my file to read the code that is set to and display it to help them remember what changes they have made as this is an example program for color codes in the

How can I URL-encode spaces in an NT batch file?

此生再无相见时 提交于 2020-01-23 08:06:18
问题 I have the misfortune of working with a program which requires all filenames passed into it to be valid URLs. (No, I don't know why.) Rather than having to drop to the command line and hand-craft file: URLs each time, I'm throwing together a batch file onto which I can simply drop files dragged from the Windows GUI. A full, proper URL encoder is beyond my needs or interest (most of the characters the app chokes on aren't valid in Windows filenames, anyway), but the two cases I do need to

Creating a batch file to identify the active Internet connection

人盡茶涼 提交于 2020-01-23 03:17:24
问题 Im trying to write a batch file which will allow a user to select their active Internet connection if there is more than one from a list generated by the netsh command and then change the DNS settings. However I can't figure out how to use the choice command when the number of options are known until the script is executed. Without the use of arrays, I have tried to create a string variable 'choices' to hold the string representing the numerical choices and pass it to the choices command, but

How to detect if input is quote?

♀尐吖头ヾ 提交于 2020-01-23 02:03:30
问题 I have the following code if "%userInput%"==""" ( do_something ) I would like it to detect if the %userInput% is a quote( " ). However, this code throws an error. How to detect if input is a quote? 回答1: Here is a solution without delayed expansion that should work with any input, including spaces and poison characters. My test code is in a loop. When you are ready to quit, simply press <Enter> without typing anything. @echo off setlocal :loop set "var=" set /p "var=enter a string: " if not

Parse and store text from a json file in windows batch script

青春壹個敷衍的年華 提交于 2020-01-23 01:37:45
问题 I have a json file with the following contents {"STATUS":"PASS","PASSRATE":96.95238} I want to store the passrate so that I can use it to append to a filename. 回答1: Check jsonextractor.bat with which you can extract information from json file by given dot notated path to object: jsonextractor.bat data.json PASSRATE 回答2: You could use Xidel for that: xidel -s data.json -e "$json/PASSRATE" 来源: https://stackoverflow.com/questions/47048992/parse-and-store-text-from-a-json-file-in-windows-batch

VB GUI Interface to run VBS Script

纵饮孤独 提交于 2020-01-23 01:29:24
问题 I have a VBS script which I need to run on a monthly basis which captures file information suhc as file Name, Type, Date Modified and more. When I processes each file it saves it all onto a CSV file so that I can process it on Excel. To run the script I setup a batch file .bat The issue is I need a GUI interface of some sort so that when the batch or vbs file is run it will ask the user to enter a drive letter to scan. This is the code I have: test.vbs: Option Explicit Dim objFS, objFld Dim