That my name is "Bill" has not helped me with Windows scripting; I gave up on it several months ago.
The following script is intended to copy files from one drive to another. Upon encountering a permissions issue, the script stops dead. I expect that the MS way to accomplish these sorts of tasks is via Visual Studio... featuring bona fide exception handling. *------------------------------------------------------------------------ Const OverWriteFiles = True startTime = Timer wScript.Echo "Beginning S Drive" strSource = "S:\Info Tech" strDestination = "C:\BackUp" Set objFSO = CreateObject ("scripting.fileSystemObject") objFSO.CopyFolder strSource, strDestination , OverWriteFiles endTime = Timer 'wScript.Echo "Ending Copy... S: Drive... It took : " & _ Round(Endtime-starttime) & "seconds to copy" *------------------------------------------------------------------------- --Bill -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Brian Leach Sent: Friday, January 25, 2008 4:02 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Execute Windows Script JayJay This is pet topic of mine: for some reason so many Windows administrators are completely unaware that Windows has truly excellent scripting facilities - particularly those who migrate from UNIX and complain about the lack of shell scripting. One great thing is that you can instantiate UniObjects connections from within the scripting host, which means you can perform many U2 sysadmin tasks far more neatly than trying to directly execute UniVerse/UniData processes with commands passed on the command line. Just one point - if you want to shell out a scripting file via the DOS /C switch, you probably need to specify the command host: cscript.exe myscript.vbs For those who don't know, Windows has two scripting hosts: cscript and wscript. They both run exactly the same scripts, which can be either javascript or vbscript: but wscript pops up message boxes for feedback and cscript is console based. You need to make sure you run cscript if you are automating. I wrote an article about UniObjects and Windows Scripting which should still be lurking on the U2UG knowledge base if anyone wants to follow up. Brian > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of John Jenkins > Sent: 24 January 2008 22:46 > To: u2-users@listserver.u2ug.org > Subject: RE: [U2] Execute Windows Script > > Windows "prefers" scripting language nowadays to BAT files. > There is an article in the IBM Knowledge Base I think in > building these for some specific activities. You could use it > as the equivalent of the Unix "at" job queue I am sure. > > Something like: > MYCMD.VBS > ------------------ > Set ShellQueue = WScript.CreateObject("WScript.shell") > ShellQueue.run "%comspec% /c c:\joblists\executable_here",O > Set ShellQueue - Nothing > > Save this as with a VBS file extension and add it to the > Windows task scheduler > > (any takers?) > > http://www.microsoft.com/resources/documentation/windows/xp/al > l/proddocs/en- > us/batch.mspx > > http://technet.microsoft.com/en-gb/library/bb490887.aspx > > > > Regards > > JayJay ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ [demime 1.01d removed an attachment of type application/msword which had a name of Script Error Message.doc] ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/