Login | |
|
 |
RE: ascii to text (outlook pst files) - 5/2/2007 1:01:33 AM
|
|
 |
|
| |
chong
Posts: 74
Score: 0
Joined: 12/20/2006
Status: offline
|
f***** visual studio >8( line 23: objShell.RegWrite strRegpath & regKey, 1, "REG_BINARY" i call asciitoHex(pst) on line 22. but when i try either writing to a txtfile or wscript.echo i get the type mismatch Dim objNetwork, FSO, pstFolder Dim strPSTpath, file, pstFiles Set objNetwork = CreateObject("Wscript.Network") strUser = objNetwork.UserName strPSTPath = "\\ex\dfs\lo_userprof\"&strUser&"\mailsettings\" wscript.echo strPSTPath 'get PST filenames. Set FSO = CreateObject("Scripting.FileSystemObject") Set pstFolder = FSO.GetFolder(strPSTPath) Set pstFiles = pstFolder.Files Set objShell = CreateObject("wscript.shell") strRegpath = "HKCU\SOFTWARE\Microsoft\Windows NT\currentVersion\Windows Messaging Subsystem\Profiles\MailProfile\" For Each pst in pstFiles regKey = AsciiToHex(pst) objShell.RegWrite strRegpath & regKey, 1, "REG_BINARY" Next Function AsciiToHex(sData) Dim i, aTmp() ReDim aTmp(Len(sData) - 1) For i = 1 To Len(sData) aTmp(i - 1) = Hex(Asc(Mid(sData, i))) if len(aTmp(i - 1))=1 then aTmp(i - 1)="0"+ aTmp(i - 1) Next ASCIItoHex = aTmp End Function
< Message edited by chong -- 5/2/2007 1:03:29 AM >
|
|
| |
|
|
|
 |
RE: ascii to text (outlook pst files) - 5/2/2007 5:43:26 AM
|
|
 |
|
| |
dm_4ever
Posts: 2585
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
I've never tried writing binary values with WScript.Shell...I prefer using WMI and StdRegProv for all my registry changes. If you try to echo or write to your text file you will get an error because you need to loop through you array to see its values or maybe use the Join function.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|