slt :
merci pour la réponse :)
en fait, j'avais déjà cherché et trouvé cet outil, et je l'ai même téléchargé
(C'est un outil externe et si il y a une astuce pratique pour l'encoder dans le bat, juste la ou les parties nécessaire, ça m'intéresse, comme du uuencode mais autoextractible.)
j'ai vu du code vbs avec fso pour récupérer la date mais c'est pas facile
Par-contre ; comment utiliser cela ; ça semble utile (j'avais demandé) :
Quid avec des (plus) gros fichiers ? Comment sont codés les caractères ?
Quid des codes spéciaux = comment ça marche avec ccm par exemple ?
ÉDIT: Est-ce que c'est compatible pour écrire un octet dans n'importe quel fichier à un offset précis SANS CHARGER TOUT LE FICHIER EN MÉMOIRE ? fso comme javascript charge obligatoirement les fichiers en mémoire si j'ai bien compris ? Est-ce que ça peut être modifié (et comment) pour fonctionner comme un éditeur hexadécimal mais piloté par un fichier en ".bat" (c'est pas optimisé et c'est lent mais le but est que je puisse le faire un peu moi-même dans un premier temps ; ensuite faut booster à fond le code = besoin d'expert(s) en codage) ?
Windows Script Host Examples (All) :
http://www.robvanderwoude.com/wshexamples.php
Convert a (small) binary file into VBScript code that can recreate that file
http://www.robvanderwoude.com/files/bin2vbs_vbs.txt
Option Explicit
Dim i, intByte
Dim objBinFile, objBinStream, objFSO, objScript
Dim strBinFile, strFileExt, strFileName, strLine, strOut, strScriptVer
strScriptVer = "1.00"
Const ForAppending = 8
Const ForReading = 1
Const ForWriting = 2
Const TristateFalse = 0
Const TristateMixed = -2
Const TristateTrue = -1
Const TristateUseDefault = -2
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
With WScript.Arguments
If .Named.Count > 0 Then Syntax
If .Unnamed.Count = 1 Then
strBinFile = .Unnamed(0)
If Not objFSO.FileExists( strBinFile ) Then Syntax
Else
Syntax
End If
End With
Set objBinFile = objFSO.GetFile( strBinFile )
Set objBinStream = objBinFile.OpenAsTextStream( ForReading, TristateFalse )
strFileName = objFSO.GetBaseName( strBinFile )
strFileExt = objFSO.GetExtensionName( strBinFile )
i = 0
strOut = "Option Explicit" & vbCrLf _
& "Dim objFile, objFSO" & vbCrLf _
& "Const ForWriting = 2" & vbCrLf _
& "Set objFSO = CreateObject( ""Scripting.FileSystemObject"" )" & vbCrLf _
& "Set objFile = objFSO.CreateTextFile( """ & strFileName & "." & strFileExt & """, False, False )" & vbCrLf
Do While Not objBinStream.AtEndOfStream
i = i + 1
If i = 10 Then
i = 0
strOut = strOut & "objFile.Write" & Mid( strLine, 3 ) & vbCrLf
strLine = ""
End If
intByte = Asc( objBinStream.Read(1) )
strLine = strLine & " & Chr(" & intByte & ")"
Loop
objBinStream.Close
Set objBinStream = Nothing
Set objBinFile = Nothing
If strLine <> "" Then strOut = strOut & "objFile.Write" & Mid( strLine, 3 ) & vbCrLf
strOut = strOut _
& "objFile.Close" & vbCrLf _
& "Set objFile = Nothing" & vbCrLf _
& "Set objFSO = Nothing" & vbCrLf _
& "WScript.Echo ""Created """"" & strFileName & "." & strFileExt & """""""" & vbCrLf
Set objScript = objFSO.CreateTextFile( strFileName & ".vbs", False, False )
objScript.Write strOut
objScript.Close
Set objScript = Nothing
Set objFSO = Nothing
Sub Syntax( )
' Display help and, optionally, debugging information
WScript.Echo "Bin2Vbs.vbs, Version " & strScriptVer & vbCrLf _
& "Convert a (small) binary file to a script that can recreate that file" _
& vbCrLf & vbCrLf _
& "Usage: BIN2VBS.VBS binfile" _
& vbCrLf & vbCrLf _
& "Where: ""binfile"" is the fully qualified path of the binary file" _
& vbCrLf & vbCrLf _
& "Result: The VBScript file will be created in the current directory," _
& vbCrLf _
& " with the NAME of the binary file, and extension "".VBS""" _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" & vbCrLf _
& "http://www.robvanderwoude.com"
WScript.Quit 1
End Sub
merci