aspx. The following
sections discuss some script techniques you can use to create robust script applications in a
command line environment.
Mapping a Network Drive
You can map a network drive using a batch file, but it??™s more difficult and error prone than using
a script. A script can provide one thing that a batch file can??™t in this case, great interactivity. Using a
script lets you interact with the user in a way that would be difficult using a batch file. In addition, the
script provides a modicum of additional error handling support that makes error handling easier.
Listing 6.3 shows a typical example of how you can implement this functionality using JavaScript.
You can obtain this example on the Sybex Web site at http://www.sybex.com/WileyCDA/.
Using Scripting Effectively
Sometimes you do need to use scripting techniques to ensure you get the right results from your command
line activities. The best rule of thumb to follow is that anything that requires direct application
access through something other than command line switches requires a script, rather than a batch file.
In addition, if you??™ve just spent five hours trying to get a batch file to work and feel that you still haven??™t
made any progress, then perhaps you??™re not using the right tool for the job.
Pages:
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474