3、脚本增强与运行指南

脚本增强与运行指南

1. 为脚本添加文档

在完成第一个脚本后,我们可以对其进行修改以增强功能。首先要做的是为脚本添加文档,这样六个月后再看脚本时,就能清楚其用途。
添加文档的方法很简单,只需在脚本中输入信息,但要防止脚本出错,需表明正在添加文本。最有效的方式是在每条注释前加上单引号(’),后跟解释性文本。

以下是添加了文档的脚本示例:

'This script displays various Computer Names by reading the registry
Option Explicit     'forces the scripter to declare variables
On Error Resume Next 'tells VBScript to go to the next line
                 'instead of exiting when an error occurs
'Dim is used to declare variable names that are used in the script
Dim objShell
Dim regActiveComputerName, regComputerName, regHostname
Dim ActiveComputerName, ComputerName, Hostname
'When you use a variable name and then an equal sign (=)
'you're saying the variable contains the information on the r
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值