trying to use mortscript to delete directory.. - Windows Mobile Software Development

hi guys,
sorry if this is not the correct place for this post..
This is in windows mobile on my HTC HD2.
I have been trying to use mortscript to create a little batch file that I could click on to remove the \Android folder and all of its contents on the root of my \Storage Card
i made this file called removeandroid.mscr
and here are the contents of that file:
******************************************
DelTree(Android)
RmDir(Android))
Message("The Android Files Have Been Deleted")
******************************************
Now, when i ran it, it deleted just about every file that was contained on my \Storage Card....
can someone help me with the syntax please ?
this file will reside on the root of the \Storage Card
possibly it might be with forward slashes in front of Android like this ....
******************************************
DelTree(Android)
RmDir(Android))
Message("The Android Files Have Been Deleted")
******************************************
the * symbols are just here for this posting, they do not reside in the file.
thanks for your help.
kevin rea
palmdale, calif.

Deltree probably did not like that you did not have a clear path to what to delete.
Try
Code:
If( DirExists("\Storage Card\Android"))
DelTree("\Storage Card\Android")
RmDir("\Storage Card\Android")
Message("The Android Files Have Been Deleted")
Else
Message("The Adroid Folder Was Not Found on Storage Card")
EndIf

Thanks very much Rory !!
Kevin Rea

Related

ROM cooking without kitchen

Hi guys,
I'm trying to edit a Universal ROM starting from nk.nbf and I'm experiencing a problem: cooked rom starts but shows taskbar with clock working properly but the remaining part of the screen seems not to draw anything and shows welcomehead image... and does not respond to taps or keypress (only powerbutton and backlight buttons working properly)
I'm used to cook roms with kitchens, so I followed these steps:
1. decode nk.nbf > nk.nba with htc tool
2. prepare_imgfs nk.nba -nosplit
3. viewimgfs imgfs_raw_data.bin
4. deleted and modified files
5. converted default.hv and user.hv in .rgu files with RGU.exe tool
6. edited .rgu registry files:
keeping key sorted as found in extracted files
every value is headed by key (not multiple values for a single key)
HKCU in user.rgu
HKLM and HKCR in default.hv​7. converted .rgu files in .hv
the RGU.exe tool adds in user.hv the value
[KKEY_LOCAL_MACHINE\System\ObjectStore\RegistryUpdate]
"boot.rgu"=hex:79,41,C3,2D,24,BD,72,20,37,79,E7,A0,B2,A9,03,CF
How to create boot.rgu?​8. replaced registry hives in dump folder
9. buildimgfs
10. make_imgfs nk.nba -noplit
I've found in KKEY_LOCAL_MACHINE\System\ObjectStore\RegistryUpdate some references to .rgu files that are not included in the rom... should i delete all .dsm files and registry references?
Thanks all...
missing rgu have been deleted before flashing, as Leo did for his latest rom 05, so your source rom is unusable
Thanks...
OK... now the new AKU 0.7.0 is available with .rgu files builtin... but rom behaviour is the same... how to work with packages.sof?
If I move all files recreating the same directory structure of a "working" kitchen and running BuildOS.exe, shall I sort out the problem?
marco.minetti said:
OK... now the new AKU 0.7.0 is available with .rgu files builtin... but rom behaviour is the same... how to work with packages.sof?
If I move all files recreating the same directory structure of a "working" kitchen and running BuildOS.exe, shall I sort out the problem?
Click to expand...
Click to collapse
you may have look here http://forum.xda-developers.com/showthread.php?t=324682
http://forum.xda-developers.com/showthread.php?t=309562
it is a nice way to cook a ROM
Thanks...
Usual cause of a startup like you descibe is a corrupt initflashfiles.dat - have you edited it directly?
If so the first 2 bytes need to removed by a hex editor to work properly.

(UPDATED 14/04) Hermes Kitchen Build 19209

Came from official htc kaiser, based from pdacorner.v9 and tools from bepe (thanks for him)
OS 5.2.19209 Build 19209.1.0.2
Not included:
- OEMApps
- OEMOperators
You need Microsoft Visual C++ 2008 Redistributable Package to using this kitchen
Updated:
- Added os.nb.payload
- Added initflashfiles.dat
Download PART1
Download PART2
Donations are welcome
Finally, A Kitchen on 19209.
Really thanks abusalza for your enormous Gift
Pouvez-vous poster un autre lien de telechargement svp, je n'arrive pas a telechargder depuis megaupload.
merci!
An other link please, i can't download from megaupload.
Thanks!
Good show sir, id highly recommend everybody making thier own ROMs based on thier own needs. Freedom of choice is always best.
Awesome brother!!!
This 19209 is the best wm6.1 build...thanks!
Quick query for people....anybody getting unhandled exceptions in buildOS?
aswell as buildxip errors?
mrvanx said:
Quick query for people....anybody getting unhandled exceptions in buildOS?
aswell as buildxip errors?
Click to expand...
Click to collapse
yup.......
mrvanx said:
Quick query for people....anybody getting unhandled exceptions in buildOS?
aswell as buildxip errors?
Click to expand...
Click to collapse
yap, i get errors too
same here..
Ive narrowed it down to the OEM folder, however im not sure what the exact issue is. Ive just replaced the OEM stuff with my own from "V10 Roller". Remember to add os.nb.payload into theROM folder or you will get an error when the insert program is run.
Also getting exceptions, tried replacing the OEM folder with a known good one but it's still happening. Any suggestions?
caeci11ius said:
Also getting exceptions, tried replacing the OEM folder with a known good one but it's still happening. Any suggestions?
Click to expand...
Click to collapse
Well, I think I solved this problem.
mrvanx said:
Ive narrowed it down to the OEM folder, however im not sure what the exact issue is. Ive just replaced the OEM stuff with my own from "V10 Roller". Remember to add os.nb.payload into theROM folder or you will get an error when the insert program is run.
Click to expand...
Click to collapse
Thanks to mrvanx's hint, I compared each OEM directories with my old kitchen tools. Then I found some stuff is missing in 'OEM\OEM_Lang_0409' directory.
So I copied my old stuff into it, then Error was gone.
Edit:
Well, I found what the problem is. the 'initflashfiles.dat' is missing in 'OEM\OEM_Lang_0409' directory. If there is 'initflashfiles.dat' even if it is 0 bytes, then this problem is solved.
I dont want to sound dumb here, but where can i get the os.nb.payload file?
curveconcepts said:
I dont want to sound dumb here, but where can i get the os.nb.payload file?
Click to expand...
Click to collapse
Not a stupid question at all....
..download a known working rom based on 19209 (theres a few around)....to get os.nb.payload from it do these following things:
(using the programs in the TOOLS folder in this kitchen)
get the os.nb from the RUU_Signed.nbh file using nbhtool (in TOOLS/HTOOLS)
split the os.nb file into os.nb.payload and os.nb.extra using:
"nbsplit -hermes os.nb" on the command line. (the nbsplit.exe must be in the same dir as os.nb before you do it).
DONE.....slap os.nb.payload into the ROM folder when uve done it.
i've tried to updated my kitchen. fiuh... very hard work. my connection was bad. God help me
Help!
Hello!
Give me please - very confused: (
Downloading kitchen, treasure initflashfiles.dat in OEM_Lang_0409, taking the OS.NP.PAYLOAD from PDACorner V9, run BuildNB.bat
BuildOS compiles all successfully, but further writes:
ImgfsFromNb 2.1RC1
Sector size is 0x200 bytes
ImgFs partition starts at 0x00620000 and ends at 0x04080000
No IMGFS signature found. Exiting.
ImgfsFromDump 2.1rc2
Input file imgfs.bin cannot be opened. Exiting.
ImgfsToNb 2.1RC1
Using bigstoragemove mode
Input file imgfs-new.bin cannot be opened. Exiting.
NBMerge 2.1RC1
Could not open input file OS-new.nb.payload
What am I doing wrong? Give please!
Yet more problems. There seems to be issues with some of the programs in the kitchen. By replacing BuildOS with another version I had around I managed to get it to run and not throw exceptions (tried the other posted solutions but had no luck with them) but it seems another program is giving me issues now. Logs:
Creating 'dump' folder...
Done!
BUILDXIP 0.54 Copyright (c) 2007-2008 bepe 30 Jan 2008
Slot 0 Boundary: 0x01fa0000
Slot 1 Boundary: 0x03e33000
RAMStart: 0x802ac000
RAMFree: 0x802e6000 - 0x83a00000 L0371a000
KernelFlags: 0x00000000
FSRamPercent: 0x00000020
Done!
Copying OS.nb.payload...
1 file(s) copied.
The system cannot execute the specified program.
Could Not Find J:\kitchen\buildpkg.wrn
The system cannot execute the specified program.
ERROR! (errorlevel: 9020)
Press any key to continue . . .
Looking at the batch files, this would indicate me that "all_packages_to_one" and "insert" are having problems (these are the lines where "cannot execute" appears). I thought it might have been a problem with 7zip, which I used to extract the archive but WinRAR has the same issue. No idea what's going on here, it's a very odd problem...
baxxik said:
Hello!
Give me please - very confused: (
Downloading kitchen, treasure initflashfiles.dat in OEM_Lang_0409, taking the OS.NP.PAYLOAD from PDACorner V9, run BuildNB.bat
BuildOS compiles all successfully, but further writes:
ImgfsFromNb 2.1RC1
Sector size is 0x200 bytes
ImgFs partition starts at 0x00620000 and ends at 0x04080000
No IMGFS signature found. Exiting.
ImgfsFromDump 2.1rc2
Input file imgfs.bin cannot be opened. Exiting.
ImgfsToNb 2.1RC1
Using bigstoragemove mode
Input file imgfs-new.bin cannot be opened. Exiting.
NBMerge 2.1RC1
Could not open input file OS-new.nb.payload
What am I doing wrong? Give please!
Click to expand...
Click to collapse
Try a different os.nb.payload fromanother ROM. The one bundled with pandora beta 9 works fine.
caeci11ius said:
Yet more problems. There seems to be issues with some of the programs in the kitchen. By replacing BuildOS with another version I had around I managed to get it to run and not throw exceptions (tried the other posted solutions but had no luck with them) but it seems another program is giving me issues now. Logs:
Creating 'dump' folder...
Done!
BUILDXIP 0.54 Copyright (c) 2007-2008 bepe 30 Jan 2008
Slot 0 Boundary: 0x01fa0000
Slot 1 Boundary: 0x03e33000
RAMStart: 0x802ac000
RAMFree: 0x802e6000 - 0x83a00000 L0371a000
KernelFlags: 0x00000000
FSRamPercent: 0x00000020
Done!
Copying OS.nb.payload...
1 file(s) copied.
The system cannot execute the specified program.
Could Not Find J:\kitchen\buildpkg.wrn
The system cannot execute the specified program.
ERROR! (errorlevel: 9020)
Press any key to continue . . .
Looking at the batch files, this would indicate me that "all_packages_to_one" and "insert" are having problems (these are the lines where "cannot execute" appears). I thought it might have been a problem with 7zip, which I used to extract the archive but WinRAR has the same issue. No idea what's going on here, it's a very odd problem...
Click to expand...
Click to collapse
You can use Microsoft Visual C++ 2008 Redistributable Package.I had the same error end it solved it.

auto-run (or maybe manual-run) type questions

I've tried to read thru some of the SDconfig and SDAutorun and autonrun threads, but come away not quite thinking they are what I am looking for.
Couple of questions:
a) what does it take to simply construct a list of
- install these cabs
- install/copy these settings files
- install these registry settings
but to only do this when I chose to execute this "script".. ie. the "auto" part of these other utilities seems like they do what I want.. but maybe take it one step further than I want..
b) Assuming I find a workable solution for a), one tool I recently became enamored with is TodayAgenda... but it stores all of its settings in the registry (no settings file I can copy/install).. I guess I can use a registry tool and export these settings, then re-import them via however I do a) ?
So yes, I find that I am flashing ROMs often enough and want to do enough customization afterwards, that I'm looking to automate parts of this process.. but the tools that exist _seem_ like they may be more than I want (at this point).
Thanks for any ideas.
Oh, and no part of me is concerned about ExtROM, etc.. all the cabs live on my SD card and would be installed to main mem.
I've done a ton of scripting in the unix world (perl and shell), but never in the Windows world (I realize the solution might just be a batch file instead of the much fancier utilities mentioned at the top)
Mortscript should be your friend than. Here's a small sample.
Alternatively look for SASHIMI over at Kaiser section.
#Work on Notifs
RemoveNotifications("repllog.exe" , "AppRunAfterTimeChange" )
#Restore & import regs
f1= "\Extended_ROM\TaskMgr.exe"
ForEach file In Files ("\Storage Card\Backup\Regs\*.reg")
RunWait ( f1, file & " /silent")
EndForEach
# copy files around
MkDir( "\Windows\Start Menu\Programs\Dan")
MkDir( "\Windows\Start Menu\Programs\Multimedia")
XCopy ("\Storage Card\Backup\Files\Dan\*.*" , "\Windows\Start Menu\Programs\Dan\", 1)
XCopy ("\Storage Card\Backup\Files\DanCard\*.*" , "\Windows\Start Menu\Programs\Dan_Card\", 1)
XCopy ("\Storage Card\Backup\Files\StartMenu\*.*" , "\Windows\Start Menu\", 1)
XCopy ("\Storage Card\Backup\Files\Programs\*.*" , "\Windows\Start Menu\Programs", 1)
XCopy ("\Storage Card\Backup\Files\Multimedia\*.*" , "\Windows\Start Menu\Programs\Multimedia", 1)
XCopy ("\Storage Card\Backup\Files\StartUp\*.*" , "\Windows\StartUp\", 1)
XCopy ("\Storage Card\Backup\Files\Windows\*.*" , "\Windows", 1)
xcopy ("\Storage Card\Backup\CorePlayer\*.*", "\Application Data\Coreplayer\",1)
xcopy ("\Storage Card\Backup\Appdb_s0\*.*", "\Windows\Appdb\",1)
dan1967 said:
Mortscript should be your friend than. Here's a small sample.
Alternatively look for SASHIMI over at Kaiser section.
Click to expand...
Click to collapse
Thanks.. I wasn't sure where to start. Will do some research on mortscript (and SASHIMI) and see how I can use them to accomplish some (or all) of what I'd like to do.
EDIT: Wow Sashimi looks to be exactly what I want. http://forum.xda-developers.com/showthread.php?t=392983

(Updated 04.02.11) HIVE AND REGISTRY FILE EDITOR

Hive and registry file editor 2.0.112
A command line utility to work with hv files.
Full Unicode support, and more.
!!! WARNING !!!
Do not use CeRegEditor (cereg) to work with .hv !!!
!!! WARNING !!!
Usage:
HVEdit.exe <rgu>|<dump>|<hive>|<hvm> [-r] [<outputdir>]
<rgu> Build boot.hv from rgu file.
<dump> Build default.hv and user.hv from project folder.
<hive> Output hive file contents to the <hivename.hvm> text file.
<hvm> Build hive file from hvm file.
-r Don't insert *.rgu hash value to the hive.
Release history:
---------------------
V. 2.0.112
+ Some changes.
V. 2.0.035
+ Extract hive to the .hvm text file.
+ Build hive from .hvm file.
V. 1.0.000 (Initial Release)
Don't need Unicode??
and I'm wondering whether the "REGEDIT4" is needed.
btxakita said:
Don't need Unicode??
Click to expand...
Click to collapse
Who spoke?
btxakita said:
and I'm wondering whether the "REGEDIT4" is needed
Click to expand...
Click to collapse
Yes.
NEW Release
V. 2.0.035
Added new functions:
+ Extract hive to the .hvm text file in Unicode format.
+ Build hive from .hvm file.
AnDim
AnDim said:
NEW Release
V. 2.0.035
Added new functions:
+ Extract hive to the .hvm text file in Unicode format.
+ Build hive from .hvm file.
AnDim
Click to expand...
Click to collapse
A dump question I'm sure, I started cooking recently and I'm wondering what I could accomplish with this application. In what scenario would I use it? Thanks, 12
Thanks. One problem I had w/ rgucomp is missing unicode support.
12aon said:
A dump question I'm sure, I started cooking recently and I'm wondering what I could accomplish with this application. In what scenario would I use it? Thanks, 12
Click to expand...
Click to collapse
What exactly is not clear?
Thanks AnDim, this makes GSM -> CDMA SYS porting much easier.
AnDim said:
What exactly is not clear?
Click to expand...
Click to collapse
Well I think I'm starting to understand. As I always have had the luxury of initflashfiles.txt or app.reg and never edited the .hv manually. It was unclear to me why I would need this or what it would add to a kitchen that supports those features (initflashfiles.txt and app.reg)
So does this app have a function in such a kitchen, I mean is there anything I will need to do manually that can't be done otherwise or is this more like a general app so that the hives on any phone can be more easily changed?
Thanks 12
@AnDim, PMed you.
Have anyone used this program? It's not working well for me. I use it fo rgu to hv convert but when i compare the output hv file with cereg alot different files
prpetrov said:
I use it fo rgu to hv convert but when i compare the output hv file with cereg alot different files
Click to expand...
Click to collapse
!!! WARNING !!!
Do not use CeRegEditor (cereg) to work with .hv !!!
how does project folder need to be set up to build default and user hv's?
BUG: Default value is imported and exported incorrectly
If I convert an rgu which contains
Code:
@="one"
"Default"="two"
hvedit overwirtes the default value with "two"
Request: option to specify output file
selyb said:
how does project folder need to be set up to build default and user hv's?
Click to expand...
Click to collapse
HVEdit.exe <My project folder>
Don`t need to be setup. Rgu´s, packages.sof and so on, can be in any sub folders.
selyb said:
BUG: Default value is imported and exported incorrectly
If I convert an rgu which contains
Code:
@="one"
"Default"="two"
hvedit overwirtes the default value with "two"
Click to expand...
Click to collapse
Hey man .... Key name "Default" == Key name @
selyb said:
Request: option to specify output file
Click to expand...
Click to collapse
??? f.e.
AnDim
sorry, I misunderstood. Until now, I didn't know you could use "Default"=
selyb said:
Request: option to specify output file
Click to expand...
Click to collapse
What I mean is like
Code:
hvedit myhive.hv myhive.txt
so hvedit would export myhive.hv to myhive.txt
selyb said:
What I mean is like
Code:
hvedit myhive.hv myhive.txt
so hvedit would export myhive.hv to myhive.txt
Click to expand...
Click to collapse
Usage:
HVEdit.exe <rgu>|<dump>|<hive>|<hvm> [-r] [<outputdir>]
<rgu> Build boot.hv from rgu file.
<dump> Build default.hv and user.hv from project folder.
<hive> Output hive file contents to the <hivename.hvm> text file.
<hvm> Build hive file from hvm file.
-r Don't insert *.rgu hash value to the hive.
AnDim
AnDim said:
Usage:
HVEdit.exe <rgu>|<dump>|<hive>|<hvm> [-r] [<outputdir>]
<rgu> Build boot.hv from rgu file.
<dump> Build default.hv and user.hv from project folder.
<hive> Output hive file contents to the <hivename.hvm> text file.
<hvm> Build hive file from hvm file.
-r Don't insert *.rgu hash value to the hive.
AnDim
Click to expand...
Click to collapse
Hi,
thanks for this software it works great, if you now how to put this commands.
My experience was this:
D:\>hvedit.exe hive d:\hive
or:
D:\>hvedit.exe hive d:\hive\user.hv
I'm getting this:
(HVEdit) !ERROR: failed building DEFAULT hives.
When I copy HVEdit.exe and cereg400.dll to d:\hive and run this:
D:\hive>hvedit.exe d:\hive\user.hv
I'm getting this:
Admsoft (R) HVEdit Version 2.0.035
Hive and registry file editor.
(C) 2009 AnDim, XDA-Developers.
(HVEdit) Extracting user.hv ...
(HVEdit) Done! and only 21.kB of 69kB .hv file
When I run it on system.hv like this:
D:\hive>hvedit.exe d:\hive\system.hv
I'm getting this:
(HVEdit) Extracting system.hv ...
ERROR: C:\MacB\private\winceos\COREOS\filesys\reg\reghive\.\registry.c line 172: Reg: Invalid reghandle 0x20000a61
and 144kB .hvm file of 105kB .hv
I didn't mention it but I was trying to convert .hv to .hvm
Maybe my dump has got some errors in it.
Any idea what is wrong, why the user.hvm is so small?
Thank you AnDim for great software. It is quite difficult to find out utility for ce hive.
After use for a period I would to to report some small problem.
1. Long multi string was trimed. (Maybe fixed length variable in code) See Ex.
Registry key in my rgu file is
REGEDIT4
[HKEY_LOCAL_MACHINE\System\StorageManager\Filters\fsreplxfilt]
"DirsToExclude"=multi_sz:"\\mxip_initdb.vol",
"\\mxip_system.vol",
"\\mxip_notify.vol",
"\\mxip_lang.vol",
"\\cemail.vol",
"\\pim.vol",
"\\Documents and Settings\\default\\user.hv",
"\\Documents and Settings\\system.hv",
"\\Windows\\Profiles\\guest\\Temporary Internet Files\\",
"\\Windows\\Profiles\\guest\\Cookies\\",
"\\Windows\\Profiles\\guest\\History\\",
"\\Windows\\Activesync\\",
"\\Windows\\messaging\\",
"\\Temp\\"
After change to boot.hv and extract back to boot.hvm the Registry is as hereunder.
; Admsoft (R) HVEdit Version 2.0.035
; Hive and registry file editor.
; (C) 2009 AnDim, XDA-Developers.
;
;
; Source file: boot.hv
; Size: 28672 byte
; Hash: e9e4f2edd12c78eeed7aceeaea22c36f
; Boothash: 1ef4fb8f2b109c0757709e7f46c71a20
; Build tool: HVEdit v2.0
[HKEY_CLASSES_ROOT]
[HKEY_CURRENT_USER]
[HKEY_LOCAL_MACHINE\System\ObjectStore\RegistryUpdate]
"boot.rgu"=hex:1E,F4,FB,8F,2B,10,9C,07,57,70,9E,7F,46,C7,1A,20
[HKEY_LOCAL_MACHINE\System\StorageManager\Filters\fsreplxfilt]
"DirsToExclude"=multi_sz:"\\mxip_initdb.vol",
"\\mxip_system.vol",
"\\mxip_notify.vol",
"\\mxip_lang.vol",
"\\cemail.vol",
"\\pim.vol",
"\\Documents and Settings\\default\\user.hv",
"\\Documents and Settings\\system.hv",
"\\Windows\\Profiles\\guest\\Temporary Internet Files\\",
"\\Windows\\Profiles\\guest\\Cookies\\",
"\\Windows\\Profiles\\guest\\History\\",
"\\Windows\\Activesync\\"
[HKEY_USERS]
; (HVEdit) Done!
2.The size of hv file is larger than original. (This is not effect functional just file size is increase from 732kb to 744kb for instance.)
After investigate, there was extra length on data key which have length just fit 32 bits size. (Maybe when adjust cell size to fit 32 bits)
Hope my comment will be some benefit for you for next version.
Regards,
AnDim said:
Hive and registry file editor 2.0.035 (C) 2009 AnDim
A command line utility to work with hv files.
Full Unicode support, and more.
!!! WARNING !!!
Do not use CeRegEditor (cereg) to work with .hv !!!
!!! WARNING !!!
Usage:
HVEdit.exe <rgu>|<dump>|<hive>|<hvm> [-r] [<outputdir>]
<rgu> Build boot.hv from rgu file.
<dump> Build default.hv and user.hv from project folder.
<hive> Output hive file contents to the <hivename.hvm> text file.
<hvm> Build hive file from hvm file.
-r Don't insert *.rgu hash value to the hive.
Release history:
---------------------
V. 2.0.035
+ Extract hive to the .hvm text file.
+ Build hive from .hvm file.
V. 1.0.000 (Initial Release)
(C) 2009 AnDim
Click to expand...
Click to collapse
This seems to be JUST what I am looking for .... but I am having problems trying to use I suspect is simply a case of finger-trouble on my part, so will greatly appreciate any help available from AnDim or any other users who can point me in the right direction, please.
I think I correctly understand the command line syntax and have run HVEdit to unpack a default.hv registry file taken from a dumped ROM (Toshiba TG01). I then made some basisc edits to the resulting .hmv file and used HVEdit again to recompile back to .hv.
When the ROM is recompiled and flashed it refused to boot. So I went back and tried using HVEdit to convert to .hmv and back without making any changes. Same problem.
I have attached the .bat files i used to run for reference....View attachment 305797
I have been reading about a need to insert REGEDIT4 at the start of the file; have tried doing so but that just results in an error.
Any guidance will be greatly appreciated
Request Response !!
Is anyone able to offer any assistance on this question please
Help will be much appreciated !
kevinpwhite said:
This seems to be JUST what I am looking for .... but I am having problems trying to use I suspect is simply a case of finger-trouble on my part, so will greatly appreciate any help available from AnDim or any other users who can point me in the right direction, please.
I think I correctly understand the command line syntax and have run HVEdit to unpack a default.hv registry file taken from a dumped ROM (Toshiba TG01). I then made some basisc edits to the resulting .hmv file and used HVEdit again to recompile back to .hv.
When the ROM is recompiled and flashed it refused to boot. So I went back and tried using HVEdit to convert to .hmv and back without making any changes. Same problem.
I have attached the .bat files i used to run for reference....View attachment 305797
I have been reading about a need to insert REGEDIT4 at the start of the file; have tried doing so but that just results in an error.
Any guidance will be greatly appreciated
Click to expand...
Click to collapse

[App] RGUber v1.21a, RGUOrder v1.4

Purpose:
This purpose of this VBScript is to process and organize data in RGU/REG files to remove duplicates, identify faulty entries, and move entries to ascending alphabetical order (the same way it is displayed in a registry editor).
Requirements:
Windows Scripting Host (included in most versions of windows)
rgucomp.exe and cereg400.dll located somewhere in your path (same folder as the script probably won't work if the script is run from another folder)
.reg and .rgu files are expected to be UTF-16LE with BOM
Usage:
Drag a .rgu, .reg, or .hv onto RGUber.vbs OR run "wscript.exe RGUber.vbs example.rgu"
Details:
When an rgu|reg file is specified, RGUber will:
1) create backup of input file
2) rename input file to boot.rgu
3) use rgucomp to convert it to *.hv
4) use rgucomp to convert new .hv to original rgu path\name
5) Reorder all keys in ascending alphabetical order and all values for each key in ascending alphabetical order with default value first
When an hv file is specified, RGUber will:
1) use rgucomp to convert it to *.rgu
2) Reorder all keys in ascending alphabetical order and all values for each key in ascending alphabetical order with default value first
Options
Open RGUber.vbs in your favorite text editor. All options are set at the beginning with (hopefully) meaningful descriptions.
Code:
'//Path to rgucomp (leave this as default if rgucomp.exe is located in your system path)
Const RGUCOMP = "rgucomp.exe"
'//Path to notepad, only needed if %OPENAFTER% is true
Const NOTEPAD = "notepad.exe"
'//The following options can be set to True/False or 0/1
'//Organize registry entries in ascending alphabetical order
Const REORDER = True
'//Open in %NOTEPAD% after conversion is done
Const OPENAFTER = False
'//Save any errors from rgu -> hv conversion
Const LOGERRORS = True
'//Save a backup copy of %INPUTRGU% as "%INPUTRGU%_Backup.rgu"
Const BACKUPRGU = True
Other info
If target file already exists, RGUber will ask if you want to overwrite.
Text files (the MS way) typically contain CRLF for next line. Output from rgucomp.exe contains many CRCRLF. RGUber removes the extra CR.
I have very few comments in the code. If requested, I will upload another copy with as many detailed comments as I can manage.
I tried to code this as efficiently as VBScript can possibly be. I kept getting errors when trying to run 'rgucomp.exe -b -nologo' so instead of running it directly, RGUber creates a bat file, executes it, then deletes it.
On my AMD Phenom 9600 with Vista64 and 3 SATA in Raid5, RGUber completes rgu->hv->rgu of 2084 lines in <3s
RGUber always saves output from rgu->hv conversion but deletes the file if there were no errors.
RGUber crashes on files with no reg entries (e.g. empty app.reg in an EXT package that does not add any registry entries)
Changelog:
v1.21a
Values are now sorted in alphabetical order for each key
v1.2
Replaced Organize function with one from RGUOrder
Lost ability to reorder values for each key (To be readded in next version)
v1.1
Fixed a bug with removing hashdata from output (RGUber would mix data from two keys under one)
Changed sorting algorith with a much faster one
v1.02
Added option to remove RegistryUpdate key from rgucomp output
Fixed a typo where RGUber was not removing the system attribute from input rgu files
v1.01
Fixed typo where RGUber was waiting for backup file instead of log file
Change 'Done' msgbox to one that shows beginning time and ending time
v1.0
Initial Release
RGUOrder v1.4
This script will only reorder the contents of an rgu without processing with RGUComp, thereby keeping comments and delete key entries. RGUComp/cereg400.dll are not needed to use this app.
Changelog:
v1.4
Fixed a bug where if the original rgu did not end with a new line then the last entry after being sorted would be lost.
Fixed two bugs where only the first 25 tabs and first 25 spaces would be removed before sorting (This did not affect data integrity or performance, but the checksum would be different each time you run the output back through RGUOrder until all the original tabs/spaces were removed)
Added code to prevent multiple entries of the same key from being reordered
Fixed other miscellaneous bugs/oddities introduced with v1.3
v1.3
Added code to add a delete key for each subkey of a deleted key so that when reordered, the key deletion isn't broken
v1.2
Fixed a bug where the last key processed was being concatenated to another with no CRLF producing an invalid rgu file
I'm not sure if this relates to your app but I have a small question:
If a dumped a rom (raw, not kitchen type) and removed several apps/programs but did not clean the registry (very tedious), will this help me clean it up (remove dead paths, etc)?
And if so, how will it know just by dragging the .hv file? I mean how will your app know if a registry entry does not have the app/program included in the rom anymore?
Please forgive me if my question does not relate to your app
There is no way for my app to know, it isnt that smart
It would take an extensive app/database to know which keys are related to which apps.
Thanks for this post
updated to v1.1
v1.02 had a bug in the code which removed hash data from output which made it mix data from the key before it with the key after it
If I ever get around to updating again, I will use hvedit instead of rgucomp
I get an error.
Script: D:\RGUber.vbs
Line: 136
Char: 2
Error: File not found
Code: 800A0035
Source: Microsoft VBScript runtime error
Any reason why?
I attach the file i want to sort alphabetically.
I have no idea
It worked for me with no problem (file attached)
Please tell me the location of RGUber.vbs and of 51329f91-0017-4364-bcff-e032c5d45b01.rgu
Great application bro!!
Only limitation is that I have to put reg400.dll and rgucomp in C:\windows
c_shekhar said:
Great application bro!!
Only limitation is that I have to put reg400.dll and rgucomp in C:\windows
Click to expand...
Click to collapse
yeah, I tried to get around that but I didn't find anything feasible with vbscript :-/
Actually, they don't have to go in C:\windows
I reinstall windows regularly so I keep as many apps portable as I can. I have a bin folder on another partition that I add to the system path variable after a new install for stuff like this.
selyb said:
yeah, I tried to get around that but I didn't find anything feasible with vbscript :-/
Actually, they don't have to go in C:\windows
I reinstall windows regularly so I keep as many apps portable as I can. I have a bin folder on another partition that I add to the system path variable after a new install for stuff like this.
Click to expand...
Click to collapse
can you elaborate this a bit more. Because I too would like a similar arranfements...
My C:\ partition has Vista64
My F:\ partition has all my documents, downloads, music, movies, etc and a folder F:\bin\
F:\bin contains >100 downloaded command line programs and vbs scripts that I have written including
RGUber.vbs
lame.exe
rgucomp.exe
cereg400.dll
FixVTS.exe
faad.exe
nuerecmod.exe
Tag.exe
find Advanced System Properties (I can't remember how, it's different for XP/Vista/7) go to the Advanced tab and hit the Environment Variables button
Under system variables, scroll down to 'Path', double click it. This defines your 'system path'. It contains a list of folders separated by semicolon ";". At the end, add a semicolon and the path to the folder you want to add (e.g. ;F:\bin) after that, hit ok. XP may need to reboot to reflect the change but I'm not sure. Vista and 7 are affected immediately.
With this setup, you can open a command prompt in any folder on your computer and type "RGUber.vbs xyz.rgu" and it would work as if all the files are in that folder.
Thanks a lot bro!!!
I am grateful...
I'd really like to use this, but unfortunately I get this error regardless of the app.reg I drag onto the script:
Script: C:\RGUber\RGUber.vbs
Line: 232
Char: 3
Error: The system cannot find the path specified.
Code: 80070003
Source: (null)
Thanks if you can advise.
Quetzecotyl said:
I'd really like to use this, but unfortunately I get this error regardless of the app.reg I drag onto the script:
Script: C:\RGUber\RGUber.vbs
Line: 232
Char: 3
Error: The system cannot find the path specified.
Code: 80070003
Source: (null)
Thanks if you can advise.
Click to expand...
Click to collapse
Hmmm... this line asks the system for what is in the %temp% variable and attempts to change the working directory to the result.
Open RGUber.vbs in notepad and go to line 232
Modify
Code:
WSH.CurrentDirectory = WSH.Environment("SYSTEM")("temp")
to
Code:
WSH.CurrentDirectory = "C:\RGUber\"
then try again
Works great after your fix, selyb. Thank you for this useful app and your many helpful contributions to the Kaiser forums.
Quetzecotyl said:
Works great after your fix, selyb. Thank you for this useful app and your many helpful contributions to the Kaiser forums.
Click to expand...
Click to collapse
Yeah, I may relocate from Kaiser forums to Rhodium. I have an AT&T Tilt 2 in the mail to me ATM
Grats on getting a Rhodium. Found a question after using it for a while. This is just one example of such behavior, but why does:
Code:
[HKEY_CURRENT_USER\Software\HTC\TaskManager\ExclusiveList\System]
"CMBandSwitching.exe"=dword:0
get turned into:
Code:
"CMBandSwitching.exe"=dword:0
How do I make it regard CURRENT_USER keys?
Quetzecotyl said:
Grats on getting a Rhodium. Found a question after using it for a while. This is just one example of such behavior, but why does:
Code:
[HKEY_CURRENT_USER\Software\HTC\TaskManager\ExclusiveList\System]
"CMBandSwitching.exe"=dword:0
get turned into:
Code:
"CMBandSwitching.exe"=dword:0
How do I make it regard CURRENT_USER keys?
Click to expand...
Click to collapse
I had this problem with an earlier version. If you are using v1.1 then please attach the original rgu/reg. I have tried and I can't seem to reproduce it since I fixed it already.
Please, replace rgucomp with hvedit . I really need your help because rgucomp doesn't work for me . Thanks in advance .
tomcug said:
Please, replace rgucomp with hvedit . I really need your help because rgucomp doesn't work for me . Thanks in advance .
Click to expand...
Click to collapse
why doesn't rgucomp work? I would be surprised to learn that hvedit will work when rgucomp won't.

Categories

Resources