Cancelado

URGENT : Write a VBS or BAT Script

THIS IS URGENT and REQUIRED WITHIN THE QUICKEST TIME POSSIBLE

I am requiring a VBS or BAT file to do the following.

1.? Loop through all websites in IIS.

2. Extract the Local Path (if not set to redirect or a share)

3. Put the Local Path into a xcopy script that will restore a folder that is located in the backup directory to the Local Path directory.

I have attempted this so far and not been able to get it past a point. I do not have time to debug this any further and after an expert at this type of IIS code.

I do not have Active Directory installed. I do however have WMI installed and working for me in other scripts.

## Deliverables

This is the VBS script so far that I wrote that I have not been able to get to work but has the example of looking through and then performing the xcopy.

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

OPTION EXPLICIT

DIM CRLF, TAB

DIM strServer

DIM objWebService

TAB? = CHR( 9 )

CRLF = CHR( 13 ) & CHR( 10 )

IF [url removed, login to view] = 1 THEN

? ? ? strServer = [url removed, login to view]( 0 )

ELSE

? ? ? strServer = "localhost"

END IF

[url removed, login to view] "Enumerating websites on " & strServer & CRLF

SET objWebService = GetObject( "IIS://" & strServer & "/W3SVC" )

EnumWebsites objWebService

SUB EnumWebsites( objWebService )

? ? ? DIM objWebServer

? ? ? FOR EACH objWebServer IN objWebService

? ? ? ? ? ? ? IF [url removed, login to view] = "IIsWebServer" THEN

'' Set the Paths for the Local Directory and Backup Directory

original_website_path = [url removed, login to view] & "\images\background\"

original_website_path =replace(original_website_path,"C:\","M:\")

backup_website_path =replace(original_website_path,"C:\","T:\bkup\")

''[url removed, login to view] backup_website_path & "*.* will be copied to " & original_website_path

wsript "xcopy " & backup_website_path & "*.* " & original_website_path & " /e /y /d /c"

? ? ? ? ? ? ? END IF

? ? ? NEXT

END SUB

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

Habilidades: Engenharia, Microsoft, MySQL, PHP, Arquitetura de software, Teste de Software, Área de trabalho do Windows

Ver mais: getobject iis strserver w3svc, wmi, Windows Active Directory, urgent urgent urgent, chr, php redirect loop, redirect loop, iis redirect, php script path, sub script, windows 2008 active directory, windows script 2008, vbs windows, php wmi, windows localhost, iis localhost work, php script echo, write bat script, script file share, redirect iis iis, script replace, 2008 wmi, backup restore active directory, echo script php, expert extract

Acerca do Empregador:
( 128 comentários ) Australia

ID do Projeto: #3021262