Webmaster Forum

Go Back   Webmaster Forum > Scripting/Programming & Debugging > ASP & VBScript Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-28-2008, 05:41 PM
bigragoo bigragoo is offline
Junior Member
 
Join Date: May 2008
Posts: 1
bigragoo is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default Error Reporting

Hi,
I am relatively new to VBScripting and have pieced together a script that works, but need some fine tuning. As a requirement if either the attribute doesn't reset or the file fails to copy an error code must be generated. I do not know how to do this and need some assistance. Here is an example of my code. Thanks

Code:
Option Explicit Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objShell: Set objShell = CreateObject("WScript.Shell") Dim strPath: strPath = Replace(WScript.ScriptFullName, WScript.ScriptName, "") Dim objEnv: Set objEnv = objShell.Environment("Process") Dim strCache, strMe, strCMD, objFile strCache = objEnv.Item("WINDIR") & "\Installer\{AFA5AA71-989F-42E1-B3AF-BC6E135617F1}\" strMe = Left(Replace(WScript.ScriptFullName,WScript.ScriptName,""), Len(Replace(WScript.ScriptFullName,WScript.ScriptName,""))-1) strCMD = strMe & "\CiscoIPCommunicatorSetup.MST" & " " If objFSO.FolderExists(strCache) = True Then Set objFile = objFSO.GetFile(strCache & "CiscoIPCommunicatorSetup.MST") objFile.Attributes = 0 If Err.Number <> 0 Then CleanEnv -1 objFSO.CopyFile strCMD, strCache, True If Err.Number <> 0 Then CleanEnv -2 end if CleanEnv 0 '---------------------------------------------------- Sub CleanEnv(intExitCode) On Error Resume Next Set objFSO = Nothing Set objEnv = Nothing Set objShell = Nothing WScript.Quit intExitCode End Sub
Reply With Quote

This ad is part of our Revenue Sharing program
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does ASP Error Handling work? seowebtools ASP & VBScript Forum 1 02-23-2007 09:50 AM
Error Handling With cftry and cfcatch seowebtools ColdFusion Forum 0 02-17-2007 02:28 AM


All times are GMT. The time now is 03:33 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30