Forum: works_in_progress


RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 13:56 | [forum:7952] |
Typo: REGEDIT /S delete .reg Batch file should be: --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user REM Reads/saves reg file. Saves the local reg REGEDIT /E local.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" REM deletes the local registry REGEDIT /S delete.reg REM adds portable reg fle REGEDIT /S portable.reg REM fixes relativepaths REGEDIT /S relative.reg start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REGEDIT /E portable.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" REM delets traces that you were there REGEDIT /S delete.reg REM restores the local copy REGEDIT /S local.reg --- |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 13:52 | [forum:7951] |
---Advanced Batch file--- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user REM Reads/saves reg file. Saves the local reg REGEDIT /E local.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" REM deletes the local registry REGEDIT /S delete .reg REM adds portable reg fle REGEDIT /S portable.reg REM fixes relativepaths REGEDIT /S relative.reg start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REGEDIT /E portable.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" REM delets traces that you were there REGEDIT /S delete.reg REM restores the local copy REGEDIT /S local.reg --- ---delete.reg--- Windows Registry Editor Version 5.00 [-HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings] --- |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 13:32 | [forum:7950] |
After I went to bed, I figured how to get around the registry deleting thing. The previous batch code will still be used and listed in the wiki, labeled "Simple". The new method will be called "Advanced/Paranoid" because it calls on a few registry files to add and delete, making it appear that the computer was never touched. NOTE: When exporting the registry file, make sure you are using HKEY_CURRENT_USER\ and not HKEY_USERS First, copy reg.reg to 2 files. Let's call it portable.reg and relative.reg. Portable.reg will be used by the add and save commands like I had attempted earlier (and then commented and uncommented to regnew.reg). It will be your registry settings, but portable. So as it gets changed, those changes are saved, rather than discarded like the Simple method. Edit relative.reg so that it only has the specific keys to messagelogpath: --- Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\xxx] "MessageLogPath"="My Documents\\My Received Files\\xxx\\History" [HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\xxx] "MessageLogPath"="My Documents\\My Received Files\\xxx\\History" --- In the above example, the xxx values are different in each line due to having 2 accounts Make a file called delete.reg, with the contents: [-HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings] That batch file will be modified so that: 1.Saves the local [HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings] to local.reg 2. Runs delete.reg to delete the tree. 3. Runs portable.reg to import the settings 4. Runs relative.reg to change portable.reg's absolute paths to relative 5. Runs msnmsgr.exe 6. On exit, saves [HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings] to ortable.reg 7. Runs delete.reg to remove evidence 8. Runs local.reg to restore previous computer settings, as if you never touched it. |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 03:41 | [forum:7949] |
Had some trouble with registry settings. Before, messagelogpath had the value: %userprofile%/... When viewed in msnmsgr.exe under Tools->Options->Messages, it turned the path to L:/directoriesleadingtothefolder/%userprofile%/... Not what I had in mind. Found a way around it though. Instead, use this as the value My Documents\My Received Files\xxx\History Where xxx is your unique username and seemingly random trailing numbers. Like username1234 Upon exit, have the batch file rerun reg.reg to write relative paths to it incase you decide to run a local copy. Should you decide to use a local copy of msnmsgr.exe, your new logs and files will appear in My Documents\My Received Files\.. as usual due to the relative paths of the reg file. On the USB drive, logs would be saved at %cd%\My Documents\My Received Files\.. --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user REGEDIT /S reg.reg start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REGEDIT /E regnew.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" REGEDIT /S reg.reg --- REGEDIT /E is uncommented and used to save the registry to a new location, should you want it for whatever reason. REGEDIT /S is called again to rewrite the relative paths for the next use, incase you login with a local copy. |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 03:07 | [forum:7948] |
Actually, the saving the reg file part never worked for me because of an error. REGEDIT /E %cd%/reg.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" is wrong. It should be REGEDIT /E reg.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" Note the removal of %cd% --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user REGEDIT /S reg.reg start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REM REGEDIT /E reg.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" --- |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 03:02 | [forum:7947] |
Just thought of something. Instead of importing and exporting: HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648 Why not just go one level higher and use: HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\ The numbers refers to a specific account. Meaning if you had used the code previously, it would only work for THAT specific account. Silly me. Remember how I said that once msnmsgr.exe runs, it turns paths into absolute paths? Yeah... Saving the reg on exit isn't a good idea. So it's commented out now. New instructions: Export as before, but export the PerPassportSettings folder instead. Code is --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user REGEDIT /S reg.reg start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REM REGEDIT /E %cd%/reg.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\" --- |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 02:42 | [forum:7946] |
Completed code, which leaves the registry behind and complete with comments, is: --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user REGEDIT /S reg.reg start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REGEDIT /E %cd%/reg.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648" --- |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 02:40 | [forum:7945] |
REGEDIT commands work REG SAVE and REG RESTORE do not. Code complete with failed attempts and comments: --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% REM set ProgramFiles=%myRootPath%\Program Files set APPDATA=%cd%\Application Data set USERNAME=user REM HKEY_USERS\S-1-5-21-1993962763-1844823847-725345543-1003\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648 REM MessageLogPath %userprofile%/Desktop REM start /MIN msnmsgr.exe pause REM Saves hive REM REG SAVE HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648 reg.hiv REM Disabled because it puts file into infinite loop REM Adds reg file REGEDIT [ /S ] reg.reg pause start msnmsgr.exe REM Checks to see if msnmsgr.exe is still running :pause tasklist | find /i "msnmsgr.exe" >nul if not %errorlevel%==1 goto :pause REM Reads/saves reg file. Incase of any changes during use REGEDIT /E %cd%/reg.REG "HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648" REM Restores previous hive REM REG RESTORE HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648 reg.hiv REM Disabled because it puts file into infinite loop pause --- When running the batch file, I was prompted around 3 times during the import registry procedure. It tries to import to: [ /S ] and finally reg.reg This is caused my improper use: "The /S swith is optional, it skips the message dialogs before and after the import of the *.REG file." http://www.robvanderwoude.com/regedit.php That specific line should read: REGEDIT /S reg.reg Looking at my exported registry file though, I noticed double / marks: "MessageLogPath"="%userprofile%\\My Documents\\My Received Files\\xxx\\History" I have not found an easy way to remove registry keys. Current theory is to take reg.reg after exiting, editting in a text editor, and replacing every occurance of "[" with "[-", saving it as a DIFFERENT reg file such as remove.reg, and running it. |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 01:13 | [forum:7944] |
HKEY_CURRENT_USER\Software\Microsoft\MSNMessenger\PerPassportSettings\xxx That's my Key Name, with xxx obfuscating my unique ID. New approach, use regedit to locate which key is my profile (look at messagelogpath and it should have your screenname). Right-click on the folder and export the reg file into the USB Windows Live Messenger. When starting the batch file, have it call the reg file and overwrite/add. For those paranoid, we can call the file again and erase the same values if wanted. But a check has to be put in place to see if a local install was there already. If not, you've be erasing your registry files if you ran the USB version on a computer with a local install that you've logged into. Using http://www.robvanderwoude.com/regedit.php as a guide: --- Adding items to the registry requires a *.REG file: REGEDIT [ /S ] addsome.REG --- REGEDIT4 [-HKEY_CURRENT_USER\DummyTree] will remove the entire tree "DummyTree". To remove an individual item from the registry, place the minus sign after the equal sign: REGEDIT4 [HKEY_CURRENT_USER\DummyTree] "ValueToBeRemoved"=- --- REGEDIT's /E switch can be used to export a registry key: REGEDIT /E d:\path\filename.REG "HKEY_XXXX\Whatever Key" This will write the registry key "HKEY_XXXX\Whatever Key" and its subkeys to a file named d:\path\filename.REG --- Self-contained registry scripts In .REG files, every line after the first one that starts with a semicolon (;) is treated as comment. Batch files completely ignore the semicolons before commands. So the following batch file will use itself as a .REG file: REGEDIT4 ; @ECHO OFF ; CLS ; REGEDIT.EXE /S "%~f0" ; EXIT [HKEY_CURRENT_USER\Software\Test] "TestVal"="Succeeded" The REGEDIT4 line is required, and must be the first line, otherwise REGEDIT.EXE won't accept the script as a valid .REG file. However, it will generate an error message when running as a batch file, hence the CLS command to wipe the error message from the screen. To prevent more error messages, EXIT is used to abort the batch file immediately after the REGEDIT.EXE command. Use this technique to add or remove registry keys and values. --- Check if reg key exists: http://www.daniweb.com/forums/thread61011.html |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 00:53 | [forum:7943] |
Across computers with the same Windows Live Messenger login account, the PerPassportSettings\xxx part is the same. Or atleast on 2 computers that my brother has logged into, the values are the same. |
RE: Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 00:44 | [forum:7942] |
Comparing the registry keys between my desktop and HP Pentium4, the changes are marked by x's: HKEY_USERS\S-1-5-21-xxx-xxx-xxx-1003\Software\Microsoft\MSNMessenger\PerPassportSettings\xxx |
Windows Live Messenger [ Reply ] By: Viet To on 2010-06-28 00:41 | [forum:7941] |
Operating System: Windows XP Service Pack 2 Program version: Windows Live Messenger Version 2009 (Build 14.0.8089.726) --- set myRootPath=%cd% set USERPROFILE=%myRootPath% set HOMEPATH=%myRootPath% set LOCALAPPDATA=%myRootPath% set APPDATA=%cd%\Application Data set USERNAME=user start /MIN msnmsgr.exe --- Program runs, however I have not tested it on a computer that has Windows Live Messenger uninstalled. The problem I run into is where chatlogs are saved. Going to the menu Tools/Options/Messages, the "Save my conversations in this folder:" is hardcoded. It does not use %userprofile% or anything similar to other programs. The way the "Change" button works, it does not allow us to type in URLS, but using absolute paths to already existing folders. Windows Live Messenger does not use a config file to store the chatlog locations. Instead, it uses the following registry key (atleast on my computer): HKEY_USERS\S-1-5-21-1993962763-1844823847-725345543-1003\Software\Microsoft\MSNMessenger\PerPassportSettings\1677426648 Name: MessageLogPath Type: REG_SZ Data: %userprofile%/Desktop Manually changing the registry value to something like %userprofile%/Desktop and running the batch file, the registry value is converted into an absolute path again. I've seen mentioning of using batch files to write registry values before, although I have not read into it because I didn't have a need to. If possible, I would have the batch file: 1. Read the current registry value and save it somewhere 2. Write new registry value, such as %userprofile%/Desktop 3. Upon exit, rewrite old value back to the registry. Step 3 is important, as by not putting the old value back makes problems for the local program and/or user of the computer. |