More VBS Scripts for System Administrators 시스템 관리자에 대한 더 많은 vbs 스크립트
Posted on March 30, 2007 at 8:56 am 게재된 2007년 3월 30일은 오전 8시 56분
Over the past few years as a Systems Admin, I’ve had to write a good number of scripts to manage desktops, security, and data backup. 지난 몇 년 동안 시스템 관리, 나는 좋은 번호를 마신의 스크립트를 작성 데스크톱을 관리, 보안, 데이터 백업을합니다. Here are a couple of short scripts that I’ve used in my environment! 여기서는 몇 개 내 환경에서 사용되는 간단한 스크립트가 나는!
How to create a shortcut on the desktop - Using this script, you can get a reference to the destop using the special folders function, so you don’t have to worry about the exact path for each user. 바탕 화면에 바로가기를 만드는 방법 -이 스크립트를 사용하여 얻을 수있습니다 특수 폴더에 대한 참조를 destop 함수를 사용하여, 그래서 정확한 경로에 대해서는 걱정하지 않아도 각 사용자에 대해합니다. Then just point to a URL or in my case, an internal web server. 그럼 그냥 지점을 또는 내 경우엔, 내부 웹 서버에합니다.
set WshShell = WScript.CreateObject(”WScript.Shell”) 세트 wshshell = wscript.createobject ( "wscript.shell")
strDesktop = WshShell.SpecialFolders(”Desktop”) strdesktop = wshshell.specialfolders ( "바탕 화면")
set oShellLink = WshShell.CreateShortcut(strDesktop & “\Support Site.URL”) 세트 oshelllink = wshshell.createshortcut (strdesktop & "\를 지원 site.url")
oShellLink.TargetPath = “http://websvr/TechSupport” oshelllink.targetpath = "http://websvr/techsupport"
oShellLink.Save oshelllink.save
How to create a folder with items in the Start Menu 폴더를 만드는 방법 시작 메뉴에서 항목을
Set FSO = CreateObject(”Scripting.FileSystemObject”) 세트 fso = createobject ( "scripting.filesystemobject")
‘Get the start menu path '시작 메뉴의 경로를 얻을
strStartMenu = WshShell.SpecialFolders(”StartMenu”) strstartmenu = wshshell.specialfolders ( "startmenu")
‘First delete the old start menu folder - mine is called Apps '최초 이전 시작 메뉴의 폴더를 삭제합니다 - 내가 호출 애플 리케이션을
‘ This is the main folder when you click All Programs, then we’ll create '이것은 모든 프로그램의 주요 폴더를 클릭하면 다음를 만들어 드리겠습니다
‘ subfolders by dept later on '하위 부서 나중에 의해
NewFolder = strStartMenu & “\Programs\Apps” newfolder = strstartmenu & "\ 프로그램 \ 애플 리케이션을"
If FSO.FolderExists( NewFolder ) then 경우 다음 fso.folderexists (newfolder)
FSO.DeleteFolder NewFolder fso.deletefolder newfolder
end if 최종 만약
‘Re-Create or create the folder '다시 -를 만들거나 폴더를 만들
If NOT FSO.FolderExists( NewFolder ) then 그런 다음 fso.folderexists하지 않으면 (newfolder)
FSO.CreateFolder NewFolder fso.createfolder newfolder
End if 최종 만약
‘Now we create sub-folders for each department '이제 우리 서브 - 폴더를 생성 각 부서에 대한
strStartMenu = WshShell.SpecialFolders(”StartMenu”) strstartmenu = wshshell.specialfolders ( "startmenu")
DeptFolder = strStartMenu & “\Programs\Apps\Dept1″ deptfolder = strstartmenu & "\ 프로그램 \ 애플 리케이션을 \ dept1"
If NOT FSO.FolderExists( DeptFolder ) then 그런 다음 fso.folderexists하지 않으면 (deptfolder)
FSO.CreateFolder DeptFolder fso.createfolder deptfolder
End if 최종 만약
‘Work around the short file name problem '짧은 파일 이름 문제를 해결
Dim ret 희미한 ret
’subst a drive to make the mapping work 'subst 드라이브를 매핑 작업을
ret = WshShell.Run (”cmd /c subst i: c:\”, 0, TRUE) ret = wshshell.run ( "cmd / c subst 나 : c : \", 0, 진실)
‘Create the links here, assign shortcut keys, path on server, and working dir '여기에 해당 링크가 작성, 할당 단축키, 경로를 서버와 작업 디렉토리
set oShellLink = WshShell.CreateShortcut(DeptFolder & “\Search Lab Track.lnk”) 세트 oshelllink = wshshell.createshortcut (deptfolder & "\ 검색 연구실 track.lnk")
oShellLink.TargetPath = “i:\SearchLab\SearchLab.exe” oshelllink.targetpath = "나 : \ searchlab \ searchlab.exe"
oShellLink.WindowStyle = 1 oshelllink.windowstyle = 1
oShellLink.Hotkey = “CTRL+SHIFT+S” oshelllink.hotkey = "ctrl + 근무 + 초"
oShellLink.IconLocation = “i:\SearchLab\SearchLab.exe, 0″ oshelllink.iconlocation = "나 : \ searchlab \ searchlab.exe, 0"
oShellLink.Description = “2 - Search Lab Track quickly” oshelllink.description = "2 - 검색 연구소를 추적 신속하게"
oShellLink.WorkingDirectory = “i:\SearchLab” oshelllink.workingdirectory = "나 : \ searchlab"
‘ You can continue to add more links into the folder, by copying this code above '당신을 계속할 수있습니다 링크를 추가하려면 폴더를 복사하여이 코드는 위의
‘remove the subst '을 제거하는 subst
ret = WshShell.Run (”cmd /c subst i: /d”, 0, TRUE) ret = wshshell.run ( "cmd / c subst 나 : / d", 0, 진실)
‘Make sure the start menu is alphatecially ordered '확인의 시작 메뉴는 주문 alphatecially
‘Deleting from the registry, can’t use regular method. '를 삭제 레지스트리에서 일반적인 방법을 사용할 수없습니다. Must delete by first deleting all subkeys and then deleting key 첫 번째를 삭제하여 삭제해야합니다 삭제 키를 모든 하위 그리고
strComputer = “.” ‘ use “.” for local computer strcomputer = "합니다."사용 "합니다."를 로컬 컴퓨터
Const HKCU = &H80000001 ‘HKEY_CURRENT_USER const hkcu = & h80000001 'hkey_current_user
Set objRegistry = GetObject _ 세트 objregistry = getobject _
(”winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\default:StdRegProv”) ( "winmgmts : (impersonationlevel = 가장할)! \ \"& strcomputer & "\ 루트 \ 기본값 : stdregprov")
KillKey HKCU, “Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu” killkey hkcu, "소프트웨어를 \ 마이크로 소프트 \ windows \ currentversion \ 탐색기 \ menuorder \ 시작 메뉴"
Sub KillKey(lHive, strKey) 하위 killkey (lhive, strkey)
Dim strElement, IsSubscriptOutOfRange 희미한 strelement, issubscriptoutofrange
Dim sKeys() 희미한 skeys ()
objRegistry.EnumKey lHive, strKey, sKeys objregistry.enumkey lhive, strkey, skeys
On Error Resume Next 다음에 오류가 재개
IsSubscriptOutOfRange = sKeys(0) issubscriptoutofrange = skeys (0)
If Err = 0 Then 만약 오류 = 0 다음
For Each strElement In sKeys skeys에서 각 strelement
KillKey lHive, strKey & “\” & strElement killkey lhive, strkey & "\"& strelement
Next 다음
End If 최종 만약
Err.Clear err.clear
objRegistry.DeleteKey lHive, strKey objregistry.deletekey lhive, strkey
End Sub 마지막 서브
How to enable the Encrypt File shorcut in the context menu - This will allow a user to right click on a file and choose Encrypt, rather than having to open the properties of the file. 암호화 파일을 사용할 수 있도록 설정하는 방법 상황에 맞는 메뉴를 shorcut - 이것을 사용하면 사용자가 파일을 마우스 오른쪽 버튼으로 클릭하여 암호화를 선택하십시오보다는 데 파일의 등록 정보를 엽니다.
‘ Create an object to hold a reference to the Wscript.Shell object '을 만들려면 개체를 개최 wscript.shell 개체에 대한 참조를
Dim objShell 희미한 objshell
Set objShell = WScript.CreateObject(”WScript.Shell”) 세트 objshell = wscript.createobject ( "wscript.shell")
‘ Create some registry keys and values using RegWrite with objShell '을 만들기로 regwrite를 사용하여 일부 레지스트리 키 및 값 objshell
objshell.RegWrite “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\EncryptionContextMenu”, 1, “REG_DWORD” objshell.regwrite "hklm \ 소프트웨어를 \ 마이크로 소프트 \ windows \ currentversion \ 탐색기 \ 고급 \ encryptioncontextmenu", 1, "reg_dword"
How to open a Word document from your file server automatically - This little script does nothing but create a link to a Word Doc off the file server and then opens it. 단어를 여는 방법에 귀하의 파일 서버에서 문서를 자동으로 -이 작은 스크립트가 아무것도 아니지만 한 마디로 연결되는 링크를 만들 파일을 서버에서 박사 후 그것이 열립니다. You can add some code to maybe open on the file only on Mondays, maybe like a once a week update to the company. 일부 코드를 추가하실 수있습니다 파일에 대한 열기에만 아마 월요일, 어쩌면 회사에서 업데이 트를 일주일에 한 번처럼합니다. Then all you have to do is update the Word file on the server. 그리고 당신이 할 수있는 일은 워드 파일을 서버에 업데이 트합니다.
Set FSO = CreateObject(”Scripting.FileSystemObject”) 세트 fso = createobject ( "scripting.filesystemobject")
set WshShell = WScript.CreateObject(”WScript.Shell”) 세트 wshshell = wscript.createobject ( "wscript.shell")
strDesktop = WshShell.SpecialFolders(”Desktop”) strdesktop = wshshell.specialfolders ( "바탕 화면")
set oShellLink = WshShell.CreateShortcut(strDesktop & “\Company News.lnk”) 세트 oshelllink = wshshell.createshortcut (strdesktop & "\ 회사 news.lnk")
oShellLink.TargetPath = “K:\Public\CompanyNews.doc” oshelllink.targetpath = "k : \ 공공 \ companynews.doc"
oShellLink.Save oshelllink.save
‘ Get a reference to the Word Application object. '단어 응용 프로그램 개체에 대한 참조를 얻을합니다.
Set appWord = Wscript.CreateObject(”Word.Application”) 세트 appword = wscript.createobject ( "word.application")
‘ Display the application. '디스플레이의 응용 프로그램.
appWord.Visible = TRUE appword.visible = 진정한
‘ Open ITdocument. '열기 itdocument합니다.
link = strDesktop & “\Company News.lnk” 링크 = strdesktop & "\ 회사 news.lnk"
appWord.Documents.Open(link) appword.documents.open (링크)
How to remove admin shares from a computer - This greatly increases security as long as you’re not using Admin shares on any of your desktops. 컴퓨터에서 관리 주식을 제거하는 방법 -이 크게 향상 보안만큼 주식에 대한 관리를 사용하지 않는 당신은 귀하의 바탕 화면.
‘ Create an object to hold a reference to the Wscript.Shell object '을 만들려면 개체를 개최 wscript.shell 개체에 대한 참조를
Dim objShell 희미한 objshell
Set objShell = WScript.CreateObject(”WScript.Shell”) 세트 objshell = wscript.createobject ( "wscript.shell")
‘ Create some registry keys and values using RegWrite with objShell '을 만들기로 regwrite를 사용하여 일부 레지스트리 키 및 값 objshell
objshell.RegWrite “HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters\AutoShareWks”, 0, “REG_DWORD” objshell.regwrite "hklm \ 시스템 \ currentcontrolset \ 서비스 \ lanmanserver \ 매개 변수를 \ autosharewks", 0, "reg_dword"
I’ll post some more later on when I have time! 내가 좀 더 나중에 게시 시간이 때!
Related Posts: 관련 게시물 :
Top things Windows System Administrators should and should not do! windows 시스템 관리자가해야 상위 것들과하지 말아야!
If you enjoyed this post, make sure you 이 게시물에 즐거워하는 경우, 있는지 확인하십시오 subscribe to my RSS feed 내 피드 구독하려면 ! !
» Filed Under »소송 아래에 IT Job Stuff 그것 직업 물건을
Related Posts 관련 게시물
- VBS Script for System Administrators - How to backup Outlook email automatically in a login or logoff script vbs 스크립트에 대한 시스템 관리자가 - 아웃룩 이메일을 백업하는 방법에 대한 로그인 또는 로그오프 스크립트를 자동으로
- How to pin a folder to the Start Menu in Windows XP 시작 메뉴에있는 폴더 핀하는 방법에 windows xp
- Another way to hide files and folders in Windows XP 또 다른 방법 windows xp에서 파일과 폴더를 숨기
- How to back up or save a Word document automatically before your computer crashes! 단어를 저장하거나 문서를 백업하는 방법을 자동으로 컴퓨터에 충돌이 발생하기 전에!
- How to view the product keys for Microsoft Windows XP or Office XP/2003 for free 마이크로 소프트의 제품 키를 보는 방법은 windows xp 또는 사무실에 대한 xp/2003을 무료로
























