If using a batch script, you can obtain the drive letter by using the 0
argument.
echo %~d0
Though if using folder mounts, you will want to keep the folder name as well.
wmic volume where label='Knox' get name
@echo off | |
setlocal | |
call :Round 12345.6 Out | |
echo %Out% | |
endlocal | |
exit /b 0 | |
:Round <Input> <Output> | |
setlocal | |
for /f "tokens=1,2 delims=." %%A in ("%~1") do set "X=%%~A" & set "Y=%%~B0" |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: This works by exploiting the set and defined commands. If the Var is null, | |
:: then the set command will fail, the error message is caught, and the defined | |
:: command will fail because there should NEVER exist a variable named =. | |
:: Usage: call :Expand A %~1 0 | |
:: The default works by exploiting how commands are parsed. If parameter 1 is | |
:: empty, then 0 will be passed to the routine as Value. | |
:: Author: David Ruhmann | |
:Expand <Var> [Value] [Default] | |
2>nul set "%~1=%~2" |
@echo off | |
:: usage: script.bat [username=%username%] | |
call :AnyActiveRemoteSessions %~1 %username% && echo Yes || echo No | |
exit /b 0 | |
:AnyActiveRemoteSessions [Username] | |
for /f "skip=1 tokens=2,4" %%A in ('query user %~1 ^| find ">"') do call :IsActiveRemoteSession "%%~A" "%%~B" && exit /b 0 | |
exit /b 1 | |
@echo off | |
call :DisplayRecursiveSubDirectoryInformation %1 | |
exit /b 0 | |
@echo off | |
setlocal disableDelayedExpansion | |
if "%~1"=="" (call :recurse ".") else call :recurse %1 |
@echo off | |
setlocal EnableDelayedExpansion | |
call :Input MyVar "Enter your string " | |
call :Write MyVar | |
echo !MyVar! | |
set MyVar | |
endlocal | |
exit /b 0 | |
:Input <Var> [Prompt] |
# Shell script to download Oracle JDK from command prompt / terminal. | |
# You can download all the binaries one-shot by just giving the BASE_URL. | |
## Features: | |
# Resumes a broken [previous] download, if any. | |
# Renames the file to a proper name with platform adding platform info. | |
# Downloads all the following from Oracle Website with one shell invocation. | |
# a. Windows 64 and 32 bit; | |
# b. Linux 64 and 32 bit; and | |
# c. API Docs. |
{ | |
"profiles": { | |
"1.7.10": { | |
"name": "1.7.10", | |
"lastVersionId": "1.7.10" | |
} | |
}, | |
"selectedProfile": "1.7.10" | |
} |
{ | |
"profiles": { | |
"Forge": { | |
"name": "Forge", | |
"lastVersionId": "1.7.10-Forge10.13.2.1230" | |
}, | |
"1.7.10": { | |
"name": "1.7.10", | |
"lastVersionId": "1.7.10" | |
} |
#include "stdafx.h" | |
#include "MessageDlg.h" | |
#include <dcp_colorscheme.h> // GetSchemeBrush | |
#include <Nursing_MsgAPI_Macros.h> // MSGWRITE* | |
// Static Value Definitions | |
#define MIN_HEIGHT 50 | |
#define MIN_WIDTH 50 | |
#define MAX_HEIGHT 500 | |
#define MAX_WIDTH 500 |