> 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.
Errors can be handled via:
ON ERROR GOTO LABEL
or ON ERROR RESUME NEXT
then IF ERR.NUMBER <> 0 THEN ...
Actually WSH is just a wrapper around scripting languages, including VB
Script, JavaScript, even Perl or PHP. So choose a language and when you
have code that can get caught on OS permissions, use the language-specific
syntax to handle such exceptions. Yes, .NET can be used too, no VS
required.
Windows file permissions is off-topic for this list but on-topic for this
thread, if you need to check/change permissions with WSH, the following
links may give you a start at understanding how it's done and/or where to
go for related info.
http://www.tek-tips.com/viewthread.cfm?qid=80789&page=396
http://cwashington.netreach.net/depo/view.asp?Index=360&ScriptType=vb
Here is one very brief intro which dispells a few myths about what WSH is
or is not.
<http://www.windowsitpro.com/articles/articleid/4729/Using_ActiveX_Objects_
to_Extend_WSHs_Functionality.html>
As mentioned elsewhere, windows scripting is quite powerful, actually
improving over the years, and yet it's quite under-used and unfamiliar to
most developer/administrators. There are some great websites and books on
the topic which may surprise people who think "Windows" is all about GUI
and devoid of real power at the command-line.
Visual Studio is a development tool which has nothing to do with scripting,
permissions, or the capabilities of the languages for which it facilitates
development. To say Windows development "requires" VS is akin to saying
Linux developers need Eclipse to navigate file permissions when a bash
script chokes - these topics are completely unrelated. One can quite
easily do any type of development without VS, including writing code that
uses any feature of the .NET Framework.
At the risk of getting political or going too far on a tangent, I think
people are so used to Microsoft bashing and calling the company Micro$oft
that most people assume or can't accept the idea that everything except the
operating system is free. If you want tools to make your life easy then
you will probably have to pay someone for it, but the OS product you
purchase has everything you need for administration and development, and
what doesn't come on the install media can be freely downloaded. I know
some people will be tempted to slam on that Reply button to say SQL Server,
Office, and Visual Studio, and a host of other tools are not free, but
those are not OS tools. Neither is U2 or any of the applications or
development tools we have to simplify our lives in the MV market.
HTH
T
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/