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