More about CMD console start , delay and set proxy

1) start a process

a.exe                     //call a.exe and wait till a.exe finish running

start a.exe            //start a.exe then goto next line

start /min a.exe   //start a in minimum size and /max for maximum size

2) wait for certain duration

2.1) by ping somewhere:

        ping -n 1 -w 4000    //wait for 4s

2.2)set time out

       timeout 180

3)wait for random duration

SET  /A mywait=  %RANDOM% * 100/32768 +15   
timeout %mywait%

4)start a process and wait for 5 s then kill it

start a.exe

timeout 5

taskkill /f /im a.exe

5) read lines in a text file

FOR /F "tokens=*" %%i IN (allText.txt) DO (
@echo %%i


6)launch internet iexplore.exe and open a url


7)launch internet iexplore.exe without any plugin

iexplore.exe –extoff

8)set proxy

netsh winhttp set proxy   //one will receive error 5: access is denied

9)run a program as administrator and then set proxy

runas.exe /savecred /user:administrator "netsh winhttp set proxy"

10)check  proxy

netsh winhttp show proxy

11)reset proxy

runas.exe /savecred /user:administrator "netsh winhttp reset proxy"

12)list all running task


13)loop forever

12.1)within a.bat call a.bat


          do something here

          goto :loopName





Now moving to


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s



%d 博主赞过: