| Set WshShell = CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("USER")
Dim work,vstr
if Wscript.Arguments.Count = 0 then
work = WshSysEnv("ADD")
if Trim( work ) = "" then
WshSysEnv("ADD") = 0
else
WshSysEnv("ADD") = Cint(work)+1
end if
Wscript.Echo WshSysEnv("ADD")
Wscript.Quit
end if
if Wscript.Arguments.Count = 1 then
if Wscript.Arguments(0) = "0" then
WshSysEnv("ADD") = 0
Wscript.Echo WshSysEnv("ADD")
Wscript.Quit
else
vstr = Wscript.Arguments(0)
work = WshSysEnv(vstr)
if Trim( work ) = "" then
WshSysEnv(vstr) = 0
else
WshSysEnv(vstr) = Cint(work)+1
end if
end if
Wscript.Echo WshSysEnv(vstr)
Wscript.Quit
end if
if Wscript.Arguments.Count = 2 then
vstr = Wscript.Arguments(0)
if Wscript.Arguments(1) = "0" then
WshSysEnv(vstr) = 0
Wscript.Echo WshSysEnv(vstr)
Wscript.Quit
else
work = WshSysEnv(vstr)
if Trim( work ) = "" then
WshSysEnv(vstr) = 0
else
WshSysEnv(vstr) = Cint(work)+Cint(Wscript.Arguments(1))
end if
end if
Wscript.Echo WshSysEnv(vstr)
Wscript.Quit
end if
| |