backup.bat

-----------------------------

 

 

ECHO OFF

ECHO Copy Begin ...

xcopy C:\dir1\file1.java C:\dir2\file2.java /Y

ECHO Copy End

PAUSE




이름에 *TBL* 인 파일 모두 지우기

D:\tmp>for /r %i in (*TBL*) do del %i



netstat -an|find "10001"

10001 번 포트를 찾을 때


하부 디렉토리의 txt 파일에서 hello there 를 찾을 때

findstr /s /c:"hello there" *.txt


findstr /p /s /c:"hello there" *.txt  (binary file 은 제외한다)

출처:http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/findstr.mspx?mfr=true


findstr /?

...

/P : 인쇄할 수 없는 텍스트가 포함된 파일은 건너뜁니다 (Printable)

/S : 현재 디렉토리와 모든 하위 디렉터리에서 일치하는 파일을 찾습니다 (Subdirectory)

/C:파일   지정된 파일롭터 찾는 텍스트를 받습니다



1. 시작 메뉴에 바로 가기 등록
C:\Documents and Settings\[USER]\시작 메뉴\프로그램\시작프로그램\abc-login.vbs 바로가기

2. register 등록
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"My VBS Script"="C:\abc\abc-login.vbs"

'abc-login.vbs
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd"
WScript.Sleep 100 '0.1 secs
WshShell.AppActivate "C:\Windows\system32\cmd.exe"
WScript.Sleep 100
WshShell.SendKeys "telnet abc.com {ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "GET /main.html?user_id=apple HTTP/1.0{ENTER}"
WshShell.SendKeys "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4{ENTER}"
WshShell.SendKeys "Host: abc.com{ENTER}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "exit{ENTER}" 'close cmd.exit


windows 에서 telnet 을 이용한 http server 자동 테스트.
test.vbs 로 저장한 뒤 더블클릭(또는 윈도 배치(시작프로그램 등)에 등록)



set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "cmd"
WScript.Sleep 100
WshShell.AppActivate "C:\Windows\system32\cmd.exe"
WScript.Sleep 100
WshShell.SendKeys "telnet yahoo.com 80{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "GET /index.html{ENTER}"
WshShell.SendKeys "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4{ENTER}"
WshShell.SendKeys "Host: yahoo.com{ENTER}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 2000
WshShell.SendKeys "exit{ENTER}" 'close cmd.exit


관리자 권한이 있는 다른 사용자로 로그인 후, 아래 디렉토리 이름을 바꾸면 된다.
c:\docs and settings\"profile name"\local settings\application data\microsoft\windows
권한 문제로 접근이 거부 된다면, 문제가 된 사용자가 c:\docs and settings\"profile name"
디렉토리의 보안항목에서 다른 사용자에게 전체 권한을 주면 된다.

아래 글을 보고 조치했다.


We experienced this problem at our office with about 11 users. The fix is to cut and paste the folder c:\docs and settings\"profile name"\local settings\application data\microsoft\windows" to another location. Log back in and problem will be resolved.

Note: to do this you must log in as another user to move this folder.

Note: local settings is a hidden folder.




http://www.techspot.com/vb/topic48091.html