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...
...ms406)
end if
'
objSWbemServices.Security_.authenticationLevel = 6
Set colitems = objSWbemServices.ExecQuery("Select * From virtualdirectory")
' inputbox which creates the backup folder if its not already there
for each objapp in colitems
arrMem =...
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...
...ms406)
end if
'
objSWbemServices.Security_.authenticationLevel = 6
Set colitems = objSWbemServices.ExecQuery("Select * From virtualdirectory")
Set colitems1 = objSWbemServices1.ExecQuery("Select * From application")
' inputbox which creates the backup folder if...
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...
..."james", "jamesjames1", ms406)
objSWbemServices.Security_.ImpersonationLevel = 3
Set colitems = objSWbemServices.ExecQuery("Select * From Application")
for each objapp in colitems
wscript.echo objapp.sitename
wscript.echo objapp.path
next
Loop
Looking into it I think I...
...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" )
For Each sitepath In paths
wscript.echo sitepath.sitename
wscript.echo sitepath.path
next
...regular expressions object
re.IgnoreCase = true 'ignore case when matching
re.Global = false 'stop after first match
re.Pattern = """(.*)?""" 'pattern to match
set matches = re.Execute(strTextSite) 'match with contents of foo variable
wscript.echo matches.item(0) 'contents of...
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.