文章目录
  1. 1. 2016-5-4
    1. 1.1. restart network adapter?
    2. 1.2. require administrator privilege at startup of batch script?
    3. 1.3. Double click .jar file to execute in windows
  2. 2. 2016-4-22
    1. 2.1. Install pip in windows

2016-5-4

restart network adapter?

1
2
wmic path win32_networkadapter where NetConnectionID="Wireless Network Connection" call disable
wmic path win32_networkadapter where NetConnectionID="Wireless Network Connection" call enable

require administrator privilege at startup of batch script?

put following script at the beginning of the batch file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------

Double click .jar file to execute in windows

Execute following script with admin privilege.

1
2
assoc .jar=jarfile
ftype jarfile="C:\DevTools\jrex86\bin\javaw.exe" -jar "%%1" %%*

Link

2016-4-22

Install pip in windows

Start with 2.7.9, pip already in python default installation package. To use it, just type python -m pip install {something}

文章目录
  1. 1. 2016-5-4
    1. 1.1. restart network adapter?
    2. 1.2. require administrator privilege at startup of batch script?
    3. 1.3. Double click .jar file to execute in windows
  2. 2. 2016-4-22
    1. 2.1. Install pip in windows