Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
echo This script is %0
This script is Hello.bat
%~I - expands %I removing any surrounding quotes (") %~fI - expands %I to a fully qualified path name %~dI - expands %I to a drive letter only %~pI - expands %I to a path only %~nI - expands %I to a file name only %~xI - expands %I to a file extension only %~sI - expanded path contains short names only %~aI - expands %I to file attributes of file %~tI - expands %I to date/time of file %~zI - expands %I to size of file
thanks this makes sense, but defo aches my brain haha!
%~d0:\ is the root directory of that drive.
Correction: %~d0\ is the root directory of the drive on which the batch file is located. (The colon is included automatically)
Where do you find this stuff?
It's all in the Microsoft Command Line Reference
Like this?Command-line Reference Updated: October 25, 2010http://technet.microsoft.com/en-us/library/cc754340%28WS.10%29.aspx
@echo offTitle Alarm:Main1set HR=00set MN=00set SC=00:MainclsEcho.set TimeEcho.%time%Echo.Use Time Format 00:00:00set /p HR=Hours:goto T1:T1clsEcho.set TimeEcho.%time%Echo.%HR%:%MN%:%SC%set /p MN=Mins:Goto T2:T2clsEcho.set TimeEcho.%time%Echo.%HR%:%MN%:%SC%set /p SC=Seconds:goto T3:T3clsEcho.set TimeEcho.%time%Echo.%HR%:%MN%:%SC%set /p Ok=Yes:1? No:2?=if "%Ok%"=="1" Goto Contif /i "%Ok%"=="yes" Goto Contif "%Ok%"=="2" Goto Main1if /i "%Ok%"=="no" Goto Main1if "%Ok%"=="" Goto T3if "%Ok%"=="%Ok%" Goto T3:Contset TT=%HR%:%MN%:%SC%.00clstitle %TT%echo.%time%if "%time%"=="%HR%:%MN%:%SC%.00" goto wakegoto Cont:wakeEcho.Wake Up!!!cd %programfiles%cd *windows Media*wmplayer "Path of your audio file"Echo.Press A Key To Turn Off.pause>nul