untitled info distro

Upload: angel-ochoa

Post on 05-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Untitled info distro

    1/3

    **'ThissubroutinesearchesfortheWebDAVserviceknownas'WebClient'and'makessurethatitisconfiguredforautomaticstartup,andthatitis'currentlyrunning.'*************************************************************************SubConfigureService()DimobjWMIServiceSetobjWMIService=GetObject("winmgmts:"_&"{impersonationLevel=impersonate}!\\.\root\cimv2")

    'Weonlycareaboutoneservice,sothesearchisonlyfor'theWebClientservice.DimcolServiceListSetcolServiceList=objWMIService.ExecQuery_("Select*fromWin32_ServicewhereName='WebClient'")

    'Ifmorethanoneservicewasreturned,somethingisfunky.'Likewise,ifnoservicesarereturned,weshouldn'tberunning.IfcolServiceList.Count=1ThenDimobjServiceForEachobjServiceincolServiceList'Testtoseeiftheserviceisscheduledtorunonstartup,ifnot,co

    nfigureitto.IfobjService.StartMode"Automatic"ThenerrReturn=objService.Change(,,,,"Automatic")EndIf'Testtoseeiftheserviceiscurrentlyrunning,ifnot,startit.IfobjService.State"Started"ThenobjService.StartService()EndIfNextElseWScript.Echo"CouldnotfindWebClientservice."EndIfEndSub

    '**********************************************************************'ThisSubroutinelaunchesanIEbrowserthatcontainstheHTMLrequired'toopenthewebfolderforviewing.ItthenfirestheOnClickevent'forthelinkinordertoopentheWebFolder.Thebrowseristhen'closed.'**********************************************************************SubLaunchBrowser()DimobjIESetobjIE=CreateObject("InternetExplorer.Application")

    objIE.Visible=falseobjIE.Navigate2"about:blank"objIE.Document.write""_&""_&"a{behavior:url(#default#AnchorClick);}"_&""_&"ClickheretofinishsettingupyourWebFolder

  • 7/31/2019 Untitled info distro

    2/3

    dy>"DimlinksSetlinks=objIE.Document.linkslinks(0).fireEvent("OnClick")objIE.QuitSetobjIE=NothingEndSub

    '*********************************************************************'Thissubroutinecreatesashortcuttothewebdisk.'*********************************************************************

    SubCreateShorty()DimstrName,strAppname,strNetHood,blnDeleteMode,objFSO,objWSHShell,objShell,objFolder,objFolderItem,blnVerboseMode,strDesktop,oMyShortCut,objDesktopIni,objNewLinkFolder,filesys,path,fso,f,ff,f1strAppname="campo-track.com_Secure_WebDisk.vbs"ConstNETHOOD=&H13&ConstMAXIMIZE_WINDOW=3strName="campo-track.comSecureWebDisk"

    SetobjFSO=CreateObject("Scripting.FileSystemObject")SetobjWshShell=CreateObject("WScript.Shell")SetobjShell=CreateObject("Shell.Application")

    SetobjFolder=objShell.Namespace(NETHOOD)SetobjFolderItem=objFolder.SelfstrNetHood=objFolderItem.Path'SetobjNewLinkFolder=objFSO.CreateFolder(strNetHood&"\"&strName)'SetobjDesktopIni=objFSO.CreateTextFile(strNetHood&"\"&strName&"\Desktop.ini")Setfilesys=CreateObject("Scripting.FileSystemObject")path=filesys.GetAbsolutePathName(strNetHood&"\"&strDomain&"\target.lnk")Iffilesys.FileExists(path)ThenstrDesktop=objWshShell.SpecialFolders("Desktop")

    SetoMyShortCut=objWshShell.CreateShortcut(strDesktop&"\"&strName&".lnk")oMyShortCut.IconLocation="%SystemRoot%\system32\SHELL32.dll,9"oMyShortCut.TargetPath=strNetHood&"\"&strDomainoMyShortCut.Description=strNameoMyShortCut.Save

    objWshShell.Runchr(34)&strDesktop&"\"&strName&".lnk"&chr(34),MAXIMIZE_WINDOWElseWScript.Echo"TherewasaproblemconnectingtotheWebDiskservice.Pleasemakesureports2078(SSL)and2077arenotfirewalled."EndIf

    EndSub

    '*********************************************************************'ThissubroutineopensWindowsExplorertoMyNetworkPlacestoshow'thelocationofthewebdisk.'*********************************************************************

  • 7/31/2019 Untitled info distro

    3/3

    '*********************************************************************'MainFunctionArea.Thisiswhereitallgoesdown.'*********************************************************************ConfigureServiceLaunchBrowserCreateShorty