欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

vbs 更改环境变量

程序员文章站 2022-07-04 20:19:24
更改 复制代码 代码如下: set wshshell = wscript.createobject("wscript.shell") wshshell.environmen...
更改
复制代码 代码如下:

set wshshell = wscript.createobject("wscript.shell")
wshshell.environment("user").item("path")="c:\ruby"

移除:
复制代码 代码如下:

wshshell.environment("user").remove("last_login_date")

附记一下这两个:
复制代码 代码如下:

set objad = createobject("adsysteminfo")
wscript.echo "your computer name is " & objad.computername
wscript.echo "your username is " & objad.username
wscript.echo("hello")
wscript.interactive = false
wscript.echo("this wont display")
wscript.interactive = true
wscript.echo("this will display")