GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/_Archive/CST1861/ExampleFiles/Lab04/ |
Upload File : |
@echo off :: shellswap.cmd :: Written by: :: Written on: :: Test if command line extensions are enabled. if "%~1"=="~1" goto:ExtensionsAreNotEnabled :: Display help when the /? parameter is passed. if NOT "%~1"=="/?" goto SkipHelp :Help echo Swaps the shell from explorer to a command line and vice versa. echo Change will take place at the next startup. echo. echo Usage: %~n0 [/r^|/s] [computer_name] echo. echo /r = Invokes a shutdown with a restart when the change is completed. echo /s = Invokes a complete shutdown when the change is completed. echo. goto:EOF :ExtensionsAreNotEnabled echo Command line extensions are not enabled. They must be enabled for %~n0 to work properly. echo %~n0 aborted. echo. goto:Help :SkipHelp setlocal enabledelayedexpansion set _computer= set _r= set _s= :: Test for /r or /s :checkArgument shift if "%~0"=="" goto:continue :: Check for extention or /m. set _temp=%~0 if /i "%_temp%" EQU "/r" goto:getRestart if /i "%_temp%" EQU "/s" goto:getShutdown if defined _computer call:error "Duplicate computer names" set _computer=%~0 goto:checkArgument :continue if defined _error goto:EOF :: Setup for reg set _computerReg= set _computerShutdown= if defined _computer set _computer=\\%_computer% if defined _computer set _computerReg=%_computer%\ if defined _computer set _computerShutdown=/m %_computer% reg query "%_computerReg%HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell 2>nul | find "explorer.exe" >nul 2>nul if errorlevel==1 ( echo y|reg add "%_computerReg%HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "explorer.exe">nul ) else ( echo y|reg add "%_computerReg%HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "cmd.exe">nul ) if NOT "%_r%%_s%"=="" ( set _flag=/s if defined _r set _flag=/r shutdown /f !_flag! %_computerShutdown% /t 0 ) goto:EOF :error echo %~1 not allowed. set _error=yes goto:EOF :getRestart if defined _r call:error "Duplicate /r switch" if defined _s call:error "Both /r and /s switchs" set _r=yes goto:checkArgument :getShutdown if defined _r call:error "Both /r and /s switchs" if defined _s call:error "Duplicate /s switch" set _s=yes goto:checkArgument ::NOTES: :: Disables normal use of windows so that someone like a CST will have to "fix" it. :: Running the script again will restore the normal windows shell (explorer).