2019年10月30日 星期三
Hwo to make HDD IO on linux system
Hwo to make HDD IO on linux system
dd if=/dev/sdb of=/dev/null
This is to read disk, and you can check HDD LED behavior.
2019年10月23日 星期三
How to write a batch file script with "administrator" permission
How to write a batch file script with "administrator" permission
Add your batch file after "::START" , your cmd command will run with administrator permission.
Add your batch file after "::START" , your cmd command will run with administrator permission.
::START
::::::::::::::::::::::::::::
------------------------
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin Shell
ECHO =============================
:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*
exit /B
:gotPrivileges
setlocal & pushd .
cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
訂閱:
文章 (Atom)
-
[Office] 自從您上次存檔後檔案 (filename.xls) 可能已由另一位使用者變更 當您嘗試將 Microsoft Excel 活頁簿儲存到網路伺服器時,如果該伺服器正在執行例如 Services for Macintosh 的中繼服務,或是在開啟活頁簿時出現...
-
Use AMISCE tool to update BIOS configuration under linux Test fucntion without change dump file 1.Copy SCELNX_64 to Linux_Flash folder 2...
-
I would like to thank you for all your support during the past years and hope that you will continue to extend the same to my replacement, ...