Guest User

usbfrient xp

a guest
Dec 4th, 2025
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VisualBasic 18.84 KB | Source Code | 0 0
  1. 'Warning, the usbfriend vbs script does not take backups.
  2. 'it uses expand.exe and makecab.exe from system32 folder
  3. 'You should browse in a disk for the XP I386 source folder
  4. 'or you will cancel the browse to abort any modifications.
  5. 'It alters USB.IN_ USBPORT.IN_ USBSTOR.IN_ TXTSETUP.SIF
  6. 'DOSNET.INF and adds USBBOOT.INF. At end You are informed
  7. 'with "Patching done !" message.
  8. 'This script work for official XP SP3 sources and with
  9. 'modified files by rvm integrator/nlite/DriverPacks
  10. 'from any languange. At the XP installation phase you
  11. 'need to have the disk connected but not afterwards.
  12. 'Note that a USB flash will stop or became readonly
  13. 'at any time because of wearing. XP setup and usage are
  14. 'faster in NTFS formated drive than FAT32. At USB boot
  15. 'windows will complain and disable the pagefile if you
  16. 'do not have hard disk.
  17. Option Explicit
  18.  
  19. Const ForReading = 1
  20. Const ForWriting = 2
  21. Const ForAppending = 8
  22. Const ReadOnly = 1
  23. Const Hidden = 2
  24. Const DelKey = 0
  25. Const AssignValueToKey = 1
  26. Const WriteKeyAsLine = 2
  27. Dim unic
  28.  
  29. Function GetFileContents(Filename)
  30.    Dim bomline, fb, sb, tb, fs
  31.  
  32.    unic = False
  33.    On Error Resume Next
  34.    set fs = CreateObject("Scripting.FileSystemObject")
  35.    bomline = fs.OpenTextFile(Filename, ForReading, False, False).Readline
  36.    If Err.Number = 53 Then   'If Filename does not exist then create an empty ascii file
  37.      On Error Goto 0
  38.       fs.CreateTextFile(Filename, True, unic).Write ""
  39.       Exit Function
  40.    ElseIf Err.Number <> 0 Then
  41.       MsgBox Err.Description & " for file: " & Filename, vbOKOnly+vbCritical, "GetFileContents aborting error:" & Err.Number
  42.       Wscript.Quit
  43.    End If
  44.    On Error Goto 0
  45.  
  46.    If Len(bomline) > 2 then
  47.       fb = Asc(bomline)
  48.       sb = Asc(mid(bomline,2,1))
  49.       tb = Asc(mid(bomline,3,1))
  50.       If (fb = 255 and sb = 254) or (fb = 254 and sb = 255) or (fb = 239 and sb = 187 and tb = 191) Then
  51.          unic = True
  52.       End If
  53.    ElseIf Len(bomline) = 2 then
  54.       fb = Asc(bomline)
  55.       sb = Asc(mid(bomline,2,1))
  56.       If (fb = 255 and sb = 254) or (fb = 254 and sb = 255) Then
  57.          unic = True
  58.       End If
  59.    End If
  60.    GetFileContents = fs.OpenTextFile(Filename, ForReading, False, unic).ReadAll()
  61. End Function
  62.  
  63. Sub SetFileContents(Filename, Contents)
  64.    On Error Resume Next
  65.  
  66.    CreateObject("Scripting.FileSystemObject").CreateTextFile(Filename, True, unic).Write Contents
  67.    If Err.Number <> 0 Then
  68.       MsgBox Err.Description & " for file: " & Filename, vbOKOnly+vbCritical, "SetFileContents aborting error:" & Err.Number
  69.       Wscript.Quit
  70.   End If
  71. End Sub
  72.  
  73. 'The Section searched for Key must pass as [sectionlabel]
  74. 'If Action = AssignValueToKey, the Key searched inside the inf/sif/ini file
  75. 'must be followed by the = so, Value will replace anything after that =
  76. 'If the Key does not exist in the file, it will created
  77. 'along with the = Value just below the Section
  78. 'If the Key inside the file is comment out, it will uncomment
  79. 'The Key or Section will also created if it is not there
  80. '
  81. 'If Action = WriteKeyAsLine the Key should contain the whole declaration
  82. 'line (with or without the =)
  83. 'That line will inserted below the Section (if it is not already there)
  84. '
  85. 'If Action = DelKey the Key will searched and the coresponing line will
  86. 'be deleted form the file
  87. 'In case of WriteKeyAsLine and DelKey the Value parameter is ignored.
  88. '
  89. 'If File does not exist the WriteInfValue it will create an ascii file
  90. 'If the File exist it will keep the same encoding (unicode or ascii)
  91. '
  92. 'Note, iniman.exe from 2003 RK, Read & Write Ini from robvanderwoude.com
  93. 'and westphil.nl aren't sufficient for the job
  94. Sub WriteInfValue(File, Section, Key, Value, Action)
  95.    Dim SectSP, SectEP, KeySP, ValSP, LineSP, LineEP, SectCont, inftxt, inftxtnew
  96.  
  97.    If File = "" Or Section = "" Or Key = "" Then Exit Sub
  98.  
  99.    inftxt = GetFileContents(File)
  100.    SectSP = InStr(1, inftxt, Section, vbBinaryCompare)
  101.    If SectSP > 0 Then
  102.       SectEP = InStr(SectSP + Len(Section), inftxt, "[", vbBinaryCompare)
  103.       If SectEP = 0 Then
  104.          SectEP = Len(inftxt) + 1
  105.       End If
  106.       SectCont = Mid(inftxt, SectSP + Len(Section), SectEP - SectSP - Len(Section))
  107.    
  108.       KeySP = Instr(1, SectCont, Key, vbBinaryCompare)
  109.       If KeySP > 0 Then
  110.          LineSP = InStrRev(SectCont, vbCrLf, KeySP - 1, vbBinaryCompare)
  111.          If LineSP = 0 Then
  112.             LineSP = 1
  113.          End If
  114.          If Action = AssignValueToKey Then
  115.             ValSP = Instr(KeySP + Len(Key), SectCont, "=", vbBinaryCompare)
  116.             If ValSP > 0 Then
  117.                Do While Mid(SectCont, ValSP + 1, 1) = " " or Mid(SectCont, ValSP + 1, 1) = vbTab
  118.                   ValSP = ValSP + 1
  119.                Loop
  120.  
  121.                LineEP = Instr(ValSP + 1, SectCont, vbCrLf, vbBinaryCompare)
  122.                If LineEP = 0 Then
  123.                   LineEP = Len(SectCont) + 1
  124.                End If
  125.                
  126.                If InStr(1, Mid(SectCont, LineSP, KeySP - LineSP), ";", vbBinaryCompare) = 0 Then
  127.                   inftxtnew = Left(SectCont, ValSP) & Value & Mid(SectCont, LineEP)
  128.                   SetFileContents File, Left(inftxt, SectSP + Len(Section) - 1) & inftxtnew & Mid(inftxt, SectEP)
  129.                Else    ' comment found in front of Key, discard everything before KeySP
  130.                  inftxtnew = Left(SectCont, LineSP - 1) & vbCrLf & Mid(SectCont, KeySP, ValSP - KeySP + 1) & Value & Mid(SectCont, LineEP)
  131.                   SetFileContents File, Left(inftxt, SectSP + Len(Section) - 1) & inftxtnew & Mid(inftxt, SectEP)
  132.                End If
  133.             End If         'Else Key found but without =, probably a comment, corrupt file or user pass wrong parameters
  134.         ElseIf Action = DelKey Then
  135.             LineEP = Instr(KeySP + Len(Key), SectCont, vbCrLf, vbBinaryCompare)
  136.             If LineEP = 0 Then
  137.                LineEP = Len(SectCont) + 1
  138.             End If
  139.             If LineSP > 0 Then
  140.                SetFileContents File, Left(inftxt, SectSP + Len(Section) - 1) & Left(SectCont, LineSP - 1) & mid(SectCont, LineEP) & Mid(inftxt, SectEP)
  141.             End If    
  142.          End If
  143.       ElseIf Action = AssignValueToKey Then
  144.          inftxt = Left(inftxt, SectSP + Len(Section) - 1) & vbCrLf & Key & " = " & Value & Mid(inftxt, SectSP + Len(Section))
  145.          SetFileContents File, inftxt
  146.       ElseIF Action = WriteKeyAsLine Then
  147.          SetFileContents File, Left(inftxt, SectSP + Len(Section) - 1) & vbCrLf & Key & Mid(inftxt, SectSP + Len(Section))
  148.       End If
  149.    ElseIf Action = WriteKeyAsLine Then
  150.       If Len(inftxt) > 0 Then
  151.          SetFileContents File, inftxt & vbCrLf & Section & vbCrLf & Key & vbCrLf
  152.       Else
  153.          SetFileContents File, Section & vbCrLf & Key
  154.       End If
  155.    ElseIf Action = AssignValueToKey Then
  156.       SetFileContents File, inftxt & vbCrLf & Section & vbCrLf & Key & " = " & Value & vbCrLf
  157.    End If
  158. End Sub
  159.  
  160.  
  161. dim odir, oShell, ofs, i386
  162.  
  163. Set odir = CreateObject("Shell.Application" ).BrowseForFolder( 0, "Select XP I386 folder." & vbCrLf & "Files needed: USB.IN_ USBPORT.IN_ USBSTOR.IN_ TXTSETUP.SIF DOSNET.INF", 0, "")
  164. If odir Is Nothing Then wscript.quit            'user cancel the browse selection to the i386 folder
  165. If not odir.self.IsFileSystem Then wscript.quit 'user select a virtual object folder like My Computer
  166. If Right(odir.Self.Path, 1) <> "\" Then
  167.    i386 = odir.Self.Path & "\"
  168. Else
  169.    i386 = odir.Self.Path
  170. End If
  171. Set ofs = CreateObject("Scripting.FileSystemObject")
  172. if not (ofs.FileExists(i386 & "USB.IN_") and ofs.FileExists(i386 & "USBPORT.IN_") and ofs.FileExists(i386 & "USBSTOR.IN_") and ofs.FileExists(i386 & "TXTSETUP.SIF") and ofs.FileExists(i386 & "DOSNET.INF")) Then
  173.    MsgBox "The " & i386 & " folder does not have the needed files.", vbOKOnly+vbExclamation, "Nothing is changed, aborting"
  174.    Wscript.Quit
  175. End If
  176.  
  177. If ofs.GetFile(i386 & "TXTSETUP.SIF").Attributes and ReadOnly then
  178.    ofs.GetFile(i386 & "TXTSETUP.SIF").Attributes = ofs.GetFile(i386 & "TXTSETUP.SIF").Attributes XOR ReadOnly
  179. End If
  180. If ofs.GetFile(i386 & "DOSNET.INF").Attributes and ReadOnly then
  181.    ofs.GetFile(i386 & "DOSNET.INF").Attributes = ofs.GetFile(i386 & "DOSNET.INF").Attributes XOR ReadOnly
  182. End If
  183.  
  184. Set oShell = CreateObject ("WScript.Shell")
  185. oShell.run "expand -r " & chr(34) & i386 & "USB.IN_" & chr(34), 0, true
  186. oShell.run "expand -r " & chr(34) & i386 & "USBPORT.IN_" & chr(34), 0, true
  187. oShell.run "expand -r " & chr(34) & i386 & "USBSTOR.IN_" & chr(34), 0, true
  188.  
  189. WriteInfValue i386 & "usb.inf", "[StandardHub.AddService]", "StartType", "0", AssignValueToKey
  190. WriteInfValue i386 & "usb.inf", "[StandardHub.AddService]", "LoadOrderGroup", "Boot Bus Extender", AssignValueToKey
  191. WriteInfValue i386 & "usb.inf", "[CommonClassParent.AddService]", "StartType", "0", AssignValueToKey
  192. WriteInfValue i386 & "usb.inf", "[CommonClassParent.AddService]", "LoadOrderGroup", "Boot Bus Extender", AssignValueToKey
  193.  
  194. WriteInfValue i386 & "usbport.inf", "[EHCI.AddService]", "StartType", "0", AssignValueToKey
  195. WriteInfValue i386 & "usbport.inf", "[EHCI.AddService]", "LoadOrderGroup", "Boot Bus Extender", AssignValueToKey
  196. WriteInfValue i386 & "usbport.inf", "[OHCI.AddService]", "StartType", "0", AssignValueToKey
  197. WriteInfValue i386 & "usbport.inf", "[OHCI.AddService]", "LoadOrderGroup", "Boot Bus Extender", AssignValueToKey
  198. WriteInfValue i386 & "usbport.inf", "[UHCI.AddService]", "StartType", "0", AssignValueToKey
  199. WriteInfValue i386 & "usbport.inf", "[UHCI.AddService]", "LoadOrderGroup", "Boot Bus Extender", AssignValueToKey
  200. WriteInfValue i386 & "usbport.inf", "[ROOTHUB.AddService]", "StartType", "0", AssignValueToKey
  201. WriteInfValue i386 & "usbport.inf", "[ROOTHUB.AddService]", "LoadOrderGroup", "Boot Bus Extender", AssignValueToKey
  202.  
  203. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "DisplayName", , DelKey
  204. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "ServiceType", , DelKey
  205. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "StartType", , DelKey
  206. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "ErrorControl", , DelKey
  207. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "ServiceBinary", , DelKey
  208. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "Tag", , DelKey
  209. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "LoadOrderGroup", , DelKey
  210.  
  211. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "LoadOrderGroup = Boot Bus Extender", , WriteKeyAsLine
  212. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "ServiceBinary  = %12%\USBSTOR.SYS", , WriteKeyAsLine
  213. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "ErrorControl   = 1", , WriteKeyAsLine
  214. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "Tag = 3", , WriteKeyAsLine
  215. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "StartType      = 0", , WriteKeyAsLine
  216. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "ServiceType    = 1", , WriteKeyAsLine
  217. WriteInfValue i386 & "usbstor.inf", "[USBSTOR.AddService]", "DisplayName    = %USBSTOR.SvcDesc%", , WriteKeyAsLine
  218.  
  219. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport.Load]", "usbehci", , DelKey
  220. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport.Load]", "usbohci", , DelKey
  221. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport.Load]", "usbuhci", , DelKey
  222. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport.Load]", "usbhub", , DelKey
  223. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport.Load]", "usbstor", , DelKey
  224.  
  225. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders.Load]", "usbehci", "usbehci.sys", AssignValueToKey
  226. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders.Load]", "usbohci", "usbohci.sys", AssignValueToKey
  227. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders.Load]", "usbuhci", "usbuhci.sys", AssignValueToKey
  228. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders.Load]", "usbhub", "usbhub.sys", AssignValueToKey
  229. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders.Load]", "usbstor", "usbstor.sys", AssignValueToKey
  230.  
  231. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport]", "usbehci", , DelKey
  232. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport]", "usbohci", , DelKey
  233. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport]", "usbuhci", , DelKey
  234. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport]", "usbhub", , DelKey
  235. WriteInfValue i386 & "TXTSETUP.SIF", "[InputDevicesSupport]", "usbstor", , DelKey
  236.  
  237. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders]", "usbehci", """Enhanced Host Controller"",files.usbehci,usbehci", AssignValueToKey
  238. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders]", "usbohci", """Open Host Controller"",files.usbohci,usbohci", AssignValueToKey
  239. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders]", "usbuhci", """Universal Host Controller"",files.usbuhci,usbuhci", AssignValueToKey
  240. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders]", "usbhub", """Generic USB Hub Driver"",files.usbhub,usbhub", AssignValueToKey
  241. WriteInfValue i386 & "TXTSETUP.SIF", "[BootBusExtenders]", "usbstor", """USB Storage Class Driver"",files.usbstor,usbstor", AssignValueToKey
  242.  
  243. WriteInfValue i386 & "TXTSETUP.SIF", "[HiveInfs.Fresh]", "AddReg = usbboot.inf,usbservices", , WriteKeyAsLine
  244. WriteInfValue i386 & "TXTSETUP.SIF", "[SourceDisksFiles]", "usbboot.inf", "1,,,,,,_x,3,,3", AssignValueToKey
  245.  
  246. WriteInfValue i386 & "DOSNET.INF", "[Files]", "d1,usbboot.inf", , WriteKeyAsLine
  247.  
  248. oShell.run "makecab /D CompressionType=LZX /D CompressionMemory=21 " & chr(34) & i386 & "USB.INF" & chr(34) & " " & chr(34) & i386 & "USB.IN_" & chr(34), 0, True
  249. oShell.run "makecab /D CompressionType=LZX /D CompressionMemory=21 " & chr(34) & i386 & "USBPORT.INF" & chr(34) & " " & chr(34) & i386 & "USBPORT.IN_" & chr(34), 0, True
  250. oShell.run "makecab /D CompressionType=LZX /D CompressionMemory=21 " & chr(34) & i386 & "USBSTOR.INF" & chr(34) & " " & chr(34) & i386 & "USBSTOR.IN_" & chr(34), 0, True
  251.  
  252. ofs.DeleteFile i386 & "USB.INF"
  253. ofs.DeleteFile i386 & "USBPORT.INF"
  254. ofs.DeleteFile i386 & "USBSTOR.INF"
  255.  
  256. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbohci"",""Type"",0x00010001,1", , WriteKeyAsLine
  257. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbohci"",""Start"",0x00010001,0", , WriteKeyAsLine
  258. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbohci"",""ImagePath"",0x00020000,""system32\DRIVERS\usbohci.sys""", , WriteKeyAsLine
  259. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbohci"",""Group"",0x00000000,""System Reserved""", , WriteKeyAsLine
  260. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbohci"",""ErrorControl"",0x00010001,1", , WriteKeyAsLine
  261. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", vbCrLf & "HKLM,""SYSTEM\CurrentControlSet\Services\usbohci"",""DisplayName"",0x00000000,""Microsoft USB Open Host Controller Miniport Driver""", , WriteKeyAsLine
  262. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbuhci"",""Type"",0x00010001,1", , WriteKeyAsLine
  263. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbuhci"",""Start"",0x00010001,0", , WriteKeyAsLine
  264. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbuhci"",""ImagePath"",0x00020000,""system32\DRIVERS\usbuhci.sys""", , WriteKeyAsLine
  265. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbuhci"",""Group"",0x00000000,""System Reserved""", , WriteKeyAsLine
  266. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbuhci"",""ErrorControl"",0x00010001,1", , WriteKeyAsLine
  267. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", vbCrLf & "HKLM,""SYSTEM\CurrentControlSet\Services\usbuhci"",""DisplayName"",0x00000000,""Microsoft USB Universal Host Controller Miniport Driver""", , WriteKeyAsLine
  268. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbhub"",""Type"",0x00010001,1", , WriteKeyAsLine
  269. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbhub"",""Start"",0x00010001,0", , WriteKeyAsLine
  270. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbhub"",""ImagePath"",0x00020000,""system32\DRIVERS\usbhub.sys""", , WriteKeyAsLine
  271. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbhub"",""Group"",0x00000000,""System Reserved""", , WriteKeyAsLine
  272. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbhub"",""ErrorControl"",0x00010001,1", , WriteKeyAsLine
  273. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", vbCrLf & "HKLM,""SYSTEM\CurrentControlSet\Services\usbhub"",""DisplayName"",0x00000000,""USB2 Enabled Hub""", , WriteKeyAsLine
  274. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbehci"",""Type"",0x00010001,1", , WriteKeyAsLine
  275. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbehci"",""Start"",0x00010001,0", , WriteKeyAsLine
  276. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbehci"",""ImagePath"",0x00020000,""system32\DRIVERS\usbehci.sys""", , WriteKeyAsLine
  277. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbehci"",""Group"",0x00000000,""System Reserved""", , WriteKeyAsLine
  278. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\usbehci"",""ErrorControl"",0x00010001,1", , WriteKeyAsLine
  279. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", vbCrLf & "HKLM,""SYSTEM\CurrentControlSet\Services\usbehci"",""DisplayName"",0x00000000,""USB 2.0 Enhanced Host Controller Miniport Driver""", , WriteKeyAsLine
  280. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\USBSTOR"",""Type"",0x00010001,1", , WriteKeyAsLine
  281. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\USBSTOR"",""Start"",0x00010001,0", , WriteKeyAsLine
  282. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\USBSTOR"",""ImagePath"",0x00020000,""system32\DRIVERS\USBSTOR.SYS""", , WriteKeyAsLine
  283. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\USBSTOR"",""Group"",0x00000000,""System Reserved""", , WriteKeyAsLine
  284. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", "HKLM,""SYSTEM\CurrentControlSet\Services\USBSTOR"",""ErrorControl"",0x00010001,1", , WriteKeyAsLine
  285. WriteInfValue i386 & "USBBOOT.INF", "[usbservices]", vbCrLf & "HKLM,""SYSTEM\CurrentControlSet\Services\USBSTOR"",""DisplayName"",0x00000000,""USB Mass Storage Driver""", , WriteKeyAsLine
  286. MsgBox "Patching done !", vbOKOnly+vbInformation, "usbfriend script"
Advertisement
Add Comment
Please, Sign In to add comment