Hi, My error handling doesn't seem to be working:
sub backup (arrmem, backupdir)
err.clear
on error resume next
set objShell = CreateObject("shell.application")
set Shellfolder = objShell.NameSpace(backupdir)
shellfolder.CopyHere (arrmem), 272
if Err.number = 0 then
'happy days
else...
Hi I have a script which deletes the files and folders within subfolders of a folder. I need to delete all folders below objFolders (C:\scripts). Here it is:
strFolder = "C:\scripts"
intDays = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolders =...
Hi I have a sub which copies files using shell.application and copyhere. It's working however I would like to get some error logging going for any files which dont copy. I've looked through the MSDN pages but there is nothing obvious so I have added my own but it doesnt work
sub backup...
Hi I have a WMI collection as below:
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
if instr (strComputer, "localhost") then
Set objSWbemServices = objSWbemLocator.ConnectServer (strComputer, "root\WebAdministration", ms406)
else
Set objSWbemServices =...
I wrote this script , it uses 7-zip after finding the files older that a given time - dunno if its any good to you:
Dim WSshell
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = wscript.createObject("wscript.shell")
'Install path of 7 Zip, ignor if using Environment...
Hi,
I have a script which pulls from IIS7 the application path, the application pool and the site name. The apppool comes from a different part of the WMI database so needs a different object to connect. Here is my code:
Const strInFile = "hostlist.txt"
Const ForReading = 1
Dim objFSO
Set...
Hi, I have a script which has an array containing file paths. I am going to use this array to prompt the user with the path and then get user interaction using an explorer browse folder to find a folder to backup the array path to.
Now, not all the paths in the array need backing up so is...
Hi,
I have a path which I need to trim down so that I have the last folder of it. The string I have is
c:\windows\system32\copyfolder.
I need to use \copyfolder as a variable elsewhere. I have looked at various functions but can seem to find anything which wors including Right, Left and...
Hi,
I have a script which puls info from WMI and creates an array with the returned information. The path information I am going to use to copy some remote files to but I need to exclude 1 particular file and copy the remaining files and folders. Here is my code so far:
Do Until...
Hi,
I have a script which I have compilled to collect some file paths. it uses set objShell = CreateObject("shell.application") and then copies files using these properties
shellfolder.CopyHere (arrmem), 20
I am getting an error on line 53 which says object required "shellfolder" but I know...
Hi,
I've been trying to remotely query using WMI an instance of IIS7. I've ritten the code which includes all the username and password but I am getting access denied.
Const strInFile = "hostlist.txt"
Const strOutFIle = "results.txt"
Const ForReading = 1
Const wbemFlagReturnImmediately =...
Hi,
I have managed to get it to work but want to get the code to do remote machines from a text file using an array, this code works OK locally How hard would this be?
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
Set paths = oWebAdmin.ExecQuery( "SELECT * FROM application" )...
Hi Geates,
I have amde some changes as I can't really have and text files kicking around..it's still using appcmd.exe:
set objShell = CreateObject("Wscript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
strSiteName = "jamess"
'Run appcmd and list complete config for the...
Hi,
I am trying to query an install of IIS 7 using VBscript and WMI but am having some problems. From what I can see there are e ways this is possible
1: IIS 7 WMI using XML
2: WMI using IIS 6
3: IIS 7 WMI
I'd like to use WMI IIS 7 and XML as the servers I will be working on only have this...
I have managed to get it working. Firstly the IP address I had given vlan1 on the 857 was clashing with th eIP address of the gateway interface to the other network - I only found this out by talking to the other network chap.
The reason the Juniper had to go was because it was not ADSL 2+...
Hi Unclerico,
Yes the 2 servers are plugged directly into the Cisco 857. The upstream kit and the network 2 are not mine, so past the HP switch I couldn't tell you what is configured but from experience I would say somewhere upstream possibly on the HP is a static route pointing to network 1
OK, here goes:
There is an HP Procurve Layer3 switch which joins 2 networks:
Network 1 - 10.3.128.0/24
Network 2 - 172.19.13.0/24
Hanging off this switch currently is a Juniper VPN router on Network 1 which has 2 servers connected on the same network (10.3.128.0/24)
At the moment there are...
Hi,
I need to allow a different LAN connected but a different switch access through my outer to its trusted interface.
I am runnning a fairly complex VPN setup but currently dont have any access lists on the vlan1 interface
If I create an access list for the subnet and then aplly this to the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.