Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF & Setlocal EnableDelayedExpansion & TITLE %~n0
- cls & MODE 1000 & CD %userprofile%\desktop
- Setlocal DisableDelayedExpansion
- set LF=^
- ::Above 2 blank lines are required - do not remove
- set ^"\n=^^^%LF%%LF%^%LF%%LF%^^"
- Set @Macro.Prompt=For /L %%n in (1 1 2) do if %%n==2 (%\n%
- For /F "tokens=1 delims=," %%G in ("!argv!") do (%\n%
- For /F "tokens=* Delims=\" %%A In ("!USERPROFILE!") Do (Set C_Prompt=%%A)%\n%
- Set C_Prompt=!C_Prompt:\=!%\n%
- Set C_Prompt=!C_Prompt:Users=!%\n%
- Set C_Prompt=!C_Prompt:Desktop=!%\n%
- For %%A in (a,b,c,d,e,f,g,h,i) Do (Set C_Prompt=!C_Prompt:%%A:=!)%\n%
- Set DirPath=%%G%\n%
- Set DirPath=!DirPath:\=/!%\n%
- Set DirPath=!DirPath: =!%\n%
- Set C_Prompt=[36m!C_Prompt![37m @ [34m!computername! [37mIn: [36m!DirPath! [31m$$ [33m %\n%
- Prompt !C_Prompt! %\n%
- ) %\n%
- ) ELSE setlocal enableDelayedExpansion ^& set argv=,
- :loop
- %@Macro.Prompt% %CD%
- Set /P command=%C_Prompt%
- Call :WhatIf command
- %command% 2>nul
- Goto :Loop
- :WhatIf
- Set "tmp=!%~1!"
- If /I "!tmp:~0,3!"=="For" (Exit /B)
- If /I "!tmp:~0,2!"=="If" (Exit /B)
- For /F "tokens=*" %%A in ("!%1!") Do (
- %%A >nul 1>nul 2>nul || ECHO( "%%A" Not succesful && Goto :Loop
- )
- Exit /B
Advertisement
Add Comment
Please, Sign In to add comment