本帖最后由 作者 于 2009-8-6 8:15:22 编辑
Dim WS, REG, Path, Key, SubKey, Value, el, flag Set WS = WScript.CreateObject("WScript.Shell") Path = WS.CurrentDirectory & "\Load.fas" Set REG = GetObject("winmgmts:\\.\root\default:StdRegProv") HKCU = &H80000001 HKLM = &H80000002 Key = "Software\Autodesk\AutoCAD" REG.GetStringValue HKCU, Key, "CurVer", Value Key = Key & "\" & Value REG.GetStringValue HKCU, Key, "CurVer", Value Key = Key & "\" & Value SubKey = "\Profiles" REG.GetStringValue HKCU, Key & SubKey, "", Value SubKey = SubKey & "\" & Value & "\Dialogs\Appload\Startup" REG.EnumValues HKCU, Key & SubKey, Item, Value If IsNull(Item) Then REG.CreateKey HKCU, Key & SubKey REG.SetStringValue HKCU, Key & SubKey, "", "1" REG.SetStringValue HKCU, Key & SubKey, "NumStartup", "1" REG.SetStringValue HKCU, Key & SubKey, "1Startup", Path SubKey = "\Applications\AcadAppload" REG.CreateKey HKCU, Key & SubKey REG.GetStringValue HKLM, Key & SubKey, "DESCRIPTION", Value REG.SetStringValue HKCU, Key & SubKey, "DESCRIPTION", Value REG.GetStringValue HKLM, Key & SubKey, "LOADER", Value REG.SetStringValue HKCU, Key & SubKey, "LOADER", Value REG.GetDWORDValue HKLM, Key & SubKey, "LOADCTRLS", Value Value = Value or 2 REG.SetDWORDValue HKCU, Key & SubKey, "LOADCTRLS", Value MsgBox "成功加入自动加载列表!" Else REG.GetStringValue HKCU, Key & SubKey, "", Value flag = False If Not IsNull(Value) Then Item = Value & "Startup" REG.GetStringValue HKCU, Key & SubKey, Item, Value If UCase(Right(Value,9))="\LOAD.FAS" Then flag = True End if IF flag Then MsgBox "TB Tools 已在自动加载列表中!" Else REG.GetStringValue HKCU, Key & SubKey, "NumStartup", Value Value = CStr(CInt(Value)+1) Item = Value & "Startup" REG.SetStringValue HKCU, Key & SubKey, "", Value REG.SetStringValue HKCU, Key & SubKey, "NumStartup", Value REG.SetStringValue HKCU, Key & SubKey, Item, Path SubKey = "\Applications\AcadAppload" REG.GetDWORDValue HKCU, Key & SubKey, "LOADCTRLS", Value Value = Value or 2 REG.SetDWORDValue HKCU, Key & SubKey, "LOADCTRLS", Value MsgBox "成功加入自动加载列表!" End if End if
该程序为本站下载,想改为非同目录下运行,就是如何做到把(指定加载同目录下的Load.fas文件),改为(指定加载不同目录下的Load.fas文件),即我的*.VBS在D:\AA\kk.VBS,而Load.fas在C:\bb\Load.fas.请高手指导,谢谢! |