Batch files in CE? - General Topics

Hello,
Is it possible to write batch files in CE? I would like to create a script to start a sequence of executables. For instance, start bluetooth, checkpoint and then TOMTOM.
Thanks,
Marco

Yes that interests me too

Yes,there was a .cab in Sin-merged Rom 2003se for Himalayas about Dos.
Try check out the post.
PS: Don't use pocket dos.

I find this
MortRunner
"With MortRunner, you can start, close, activate, and hide programs, and even remote control them to a certain degree.
It's more an hacker tool without a nifty interface, which can execute some kind of batch files..."

Here you can d/l the latest beta. There's not much new there, but it might be useful for some...
- Includes a tool to support WM's autorun on storage card insert/remove
- Rotate command
- .mortrun extension only registered when started without parameters (to avoid it's changed to the autorun folder)
(Don't worry about the German forum, the zip includes an English manual)

Mort > Thanks for your work
Is there a way to create a ".mortrun" file to mute/unmute the system sound ?
I'd like to do this to be able to use a shortcut to this file and so voice command mute/unmute via Microsoft Voice Command.
See this thread

DocteurN said:
Is there a way to create a ".mortrun" file to mute/unmute the system sound ?
Click to expand...
Click to collapse
No.

Related

TUTORIAL: Periodically & automatically backing up an important file to a memcard

I’ve received the following question in the Smartphone & Pocket PC Magazine forums:
“I have a HX4700 with a Garmin CF620 Compact Flash GPSr unit.
This unit uses the Garmin QUE software for navigational purposes.
The active track-log is saved in a single file in the installation directory (program files) and on two occasions I've lost the tracklog and almost got myself in an emergancy situation due to either a battery issue or the necessity to do a hard reset.
My question is if you perhaps know of a 3rd party software that I can use to either in real-time or given time intervals mirror / sync the file to the Ipaq file store or external memory .
I'll even be happy if its a program that I have to run to copy the file to another location, then I can at least assign it to a button, and press it every so often.”
The answer to this question is a big YES, you can do this, without having to use a full system backup. What is more, you can do this with a free (!) and fully automatic tool – I’ve custom-written an nScriptm script which does exactly what you want.
I’ve already elaborated a lot on the possible usages of the excellent nScriptm; please see for example this and this article, along with the links. (Search for “nScriptm” with Ctrl-F if you don’t want to read the entire article. I, however, as usual, recommend reading these articles in their entirety if you want to know how Pocket PC screenshots can be taken and how calls can be (automatically) recorded.)
To solve the problem asked by my reader, as I've already stated, I’ve written an nScriptm script. It’s available here for download. After you edit it to point to the source and the target files (they are \Program Files\source.txt and \SD-MMCard\backup.txt by default; you can, in general, leave the latter filename intact and only change the storage card path), you MUST put it in the \Program Files\ns\ directory (you must create it at first) so that the executable link file, which is available here, can find it. You must do the same with the executable file (ns.exe) of nScriptm available here – that is, put it in \Program Files\ns\.
Note that, along with the source and, possibly, the target filenames, you can also modify the interval of the backup. It’s 120 seconds by default. If you want to set it to another value, just modify the parameter in sleep(120).
You can, of course, put the executable link file, PeriodicallyBackupAFile.lnk, to \Windows\Start Menu\Programs for easy access.
Now, just start the backup tool by executing the latter executable link file and minimize nScriptm. It’ll continue running in the background and backing up your file.
Other alternatives
Note that you can also do the same with the excellent SKScheMa, which is another product of the excellent S-K people also written (more precisely, ported) nScriptm and a lot of other, high-quality tools like SKTools. With it, you can for example backup your stuff every, say, hour. The advantage of the SKScheMa-based solution that it doesn’t need to be always run in the background. That way, you can lower the CPU / memory usage.
Also, if you know how you can manually add timed, recurring events with, say, SKTools, you can manually execute a simple filecopy (without periodicity – that is, modify script to the following:
function main() {CopyFile("\\Program Files\\source.txt","\\SD-MMCard\\backup.txt");}
and just configure your event queue to execute the link file it, say, every hour.)
For geeks
For programmers or anyone that would like to know how it works and how easy nScriptm is to use, the script is as follows:
function main()
{
while(1<2)
{CopyFile("\\Program Files\\source.txt","\\SD-MMCard\\backup.txt");
sleep(120);}
}
(Note that there is no “true” symbolic constant in nScriptm and, therefore, I couldn’t use while(true) and you must escape backslash characters as with all C-like languages / regexps; this is why there are "doubled" backslash characters.)

[PRJ][ROM][KITCHEN]o.r.e.e. wwe v3.07.720.05 [2008-11-09]

Open.
Rom.
Elf/In.
Edition.
v3.07.720.05
​The Bases of the ELF/IN kitchen based on the last HTC ELFIN wm 6.1 build.
It works on ELF but expect little space left.
But at the very least this should give everyone an impression of the eas of Cooking and Flashing your own Modified Rom this Kitchen will have for those not that familiar with the hardcore part.
This is a Community project, meaning that Core modifications to the OS, packages, XIP can be added by anyone.
Recommended and Submitted packages will need New Unique DSM files, preferably handmade (not throughErvius Package creator unless the DSM file is remade). These should then be populated without the option.xml file and initflashfiles.txt. I will then add the option.xml value to the main option.xml file.
Myself i will be mostly concentrating on getting all dutch 0413 packages in therefor multi language support and making a vanilla version and adding all that is needed to make it similar to the Surface Rom.
As always be sure you have the Latest Unlocked Hard SPL. (working with 2,26 on my Elf works but read that 3.0 is better on ELFIN)
Needed: OS.nb.payload from 3.0 (ATM moment it's using Bepe's original OS.nb.payload)
Changelog
>>=IN <<=OUT​
>> (v3.07.720.04) Made HTC Volume into regular Service and since it's a constant running service, made it into Modules. Added Dutch MUI file and set to disabled by Default.
>> (v3.07.720.05) Moved RtspHandler.dll to StreamingSourcefilter package, Updated, voFltRTSP.dll Added registry settings to eb139d20-aafa-11dd-ad8b-0800200c9a66. Streams should now open in WMP without the need to Include Streaming Media PLayer app, which therefore is disabled by Default.
<< (v3.07.720.05) Removed PegHelp,
>> (v3.07.720.05) Added Mort and AppToDate Moved Templates to MortZip inStall, added updated Provider Setup with multiple options (Slim and Auto)
>> (v3.07.720.06) Added DSIXDA's Payload
<< (v3.07.720.06) Removed ULDR partition with great guide from HTCTouchP
>> (v3.07.720.06) Replaced biotouch.dll with an older one posted by DSIXDA
Downloads
Versions:
O.R.E.E v3.07.720.04
O.R.E.E v3.07.720.05
Downloads
Working with Mort installation in the Rom.
Link creation is not done by modifying the initflashfiles.dat/txt
Inside the package add a line to the RGU.
Code:
[HKEY_LOCAL_MACHINE\Software\Mortinstall\LNK] "YouTube0409.lnk"=dword:1
Or
Code:
[HKEY_LOCAL_MACHINE\Software\Mortinstall\LNK] "YouTube0413.lnk"=dword:1
This will then correspond to lines in the SPC.mscr
Code:
if (RegRead( "HKLM", "Software\Mortinstall\LNK", "YouTube0413.lnk" ) eq 1)
CreateShortcut("\Windows\Startmenu\Programma's\MultiMedia\YouTube.lnk","\Windows\YouTube.exe")
Else
EndIf
if (RegRead( "HKLM", "Software\Mortinstall\LNK", "YouTube0409.lnk" ) eq 1)
CreateShortcut("\Windows\Start Menu\Programs\MultiMedia\YouTube.lnk","\Windows\YouTube.exe")
Else
EndIf
Or a more complex installation script
Code:
if (RegRead( "HKLM", "Software\Mortinstall\LNK", "Google Maps.lnk" ) eq 1)
MkDir("\Application Data\GoogleMaps")
UnzipAll( "\Windows\GMM.zip", "\Programmabestanden" )
MkDir("\Windows\Startmenu\Programma's\Contacten")
MkDir("\Windows\Startmenu\Programma's\GPS")
CreateShortcut("\Windows\Startmenu\Programma's\GPS\Google Maps.lnk","\Programmabestanden\GoogleMaps\GoogleMaps.exe")
CreateShortcut("\Windows\Startmenu\Programma's\Contacten\Google Maps.lnk","\Programmabestanden\GoogleMaps\GoogleMaps.exe")
CreateShortcut("\Windows\Appbuttons\Google Maps.lnk","\Programmabestanden\GoogleMaps\GoogleMaps.exe")
Copy( "\Programmabestanden\GoogleMaps\strings-all.zlb", "\Application Data\GoogleMaps\strings-all.zlb" )
Delete( "\Programmabestanden\GoogleMaps\strings-all.zlb" )
Else
EndIf
This gives maximum leverage to create the cleanest possible Rom Cooking and eliminates some of the applications HTC has been adding to roms to do the same.
As all these operations run at second boot, the chance of ProvXML files interfering can be ignored.
Also it gives the alternative of doing something else if the registry setting is not found.
Code:
if (RegRead( "HKLM", "Software\Mortinstall\LNK", "CommManager.lnk" ) eq 1)
CreateShortcut("\Windows\Startmenu\Programma's\CommManager.lnk","\Windows\CommManager.exe")
CreateShortcut("\Windows\Appbuttons\CommManager.lnk","\Windows\sddialer.exe")
Else
WriteFile("\Windows\Startmenu\Programma's\CommManager.lnk", "99#""\Windows\wrlsmgr.exe""?shellres.192.dll,-13999")
WriteFile("\Windows\Appbuttons\CommManager.lnk", "99#""\Windows\wrlsmgr.exe""?shellres.192.dll,-13999")
EndIf
Besides just the shortcut creation a whole lot else can be done.
Like adding different Registry entries if a specific app is not present etc etc.
this is one project i m gonna enjoy visiting regularly.
ps: if this post is in the way....delete it.....ur the MOD bro
Visiting....?
I heard you where going to Fix it
Noonski said:
Visiting....?
I heard you where going to Fix it
Click to expand...
Click to collapse
then FIXING it is bro
Start
This looks good. Thanks for that Noonski.
Hey Noonski,
Just a heads up -- the Task Manager OEM for this new Elfin ROM has a bug.
If you try to close a task (in the X-Button Task Manager) while the ActiveSync task is open, it will also close the ActiveSync, but the other tasks are untouched.
I don't know if it's a registry issue or not, but I went back to the Opal Task Manager and that one is fine.
dsixda said:
Hey Noonski,
Just a heads up -- the Task Manager OEM for this new Elfin ROM has a bug.
If you try to close a task (in the X-Button Task Manager) while the ActiveSync task is open, it will also close the ActiveSync, but the other tasks are untouched.
I don't know if it's a registry issue or not, but I went back to the Opal Task Manager and that one is fine.
Click to expand...
Click to collapse
Good in that case i will switch it with the Diamond Magic Taskmanager and remove the 64png files that are not needed on QVGA, (Edit, it does need the graphics)
I'll check the Bug thanks.
This ROM is also missing the Task Manager in the Program shortcuts. Same goes for Backlight and Key Lock in Settings.
I can add all of them manually, no problem. But if I try to cook the Task Manager shortcut, it doesn't work!! I'm trying to put it into an initflashfiles.txt file like this, but it won't work:
Directory("\windows\start Menu\programs"):-File("Task Manager.lnk","\windows\TaskMgr.lnk")
Doesn't get copied to the Start Menu Programs even though TaskMgr.lnk exists under Windows.
dsixda said:
This ROM is also missing the Task Manager in the Program shortcuts. Same goes for Backlight and Key Lock in Settings.
I can add all of them manually, no problem. But if I try to cook the Task Manager shortcut, it doesn't work!! I'm trying to put it into an initflashfiles.txt file like this, but it won't work:
Directory("\windows\start Menu\programs"):-File("Task Manager.lnk","\windows\TaskMgr.lnk")
Doesn't get copied to the Start Menu Programs even though TaskMgr.lnk exists under Windows.
Click to expand...
Click to collapse
Does the same happen after removing
Directory("\Windows\Start Menu\Programs"):-File("\x0054\x0061\x0073\x006B\x0020\x004D\x0061\x006E\x0061\x0067\x0065\x0072\x002E\x006C\x006E\x006B","\Windows\TaskMgr.lnk")
From initflashfiles.dat?
[HKEY_LOCAL_MACHINE\ControlPanel\MyCpl\41]
"Name"="KeyLock"
"Description"="KeyLock"
"File"="Keylock.exe"
"CmdLine"=""
Might do the trick for any missing control panel applet.
And if it's the HTC taskmanager you mean it might be that the DSM fille need to be recreated correctly.
As with the Diamond ORDE kitchen initflashfiles will be not needed anymore.
And ah i also found
mxipupdate_zzRemoveTSKmgr_1.provxml
Option.XML
This kitchen will eventually have only one option.xml file.
This is so that when it is finished Users can post their own personal option.xml file.
So there can be an Option.xml file that is clean, full, Dutch, English, etc etc.
It's a basic function from BuildOS that hasn't been used that much anymore.
Updated version coming up...... with an example of this option.xml file method.
Taskmanager problem is solved and also Taskmanager seems to close Active Sync correctly.
But somehow Taskmanager is not starting Connectionsetup automaticly like it does on Diamond.
Also removed the OperaPreL.exe from Bootlauncher startup.
But it looks like i will be needing to send my ELF for Repair. The screen is getting harder and harder to react to presses in the Middle.
Fortunately i have lost my fear of Blind Cooking
Remote Tracker
In the Next version Remote Tracker will be included.
It is set to copy it's configuration file from the Storage Card\Cabs folder.
Even if a User is not using UC.
the configuration file can also be cooked in by adding it to the Package in the Kitchen.
Basicly what Remote tracker does is send an SMS to a predefined number when the SIM card is switched. (you can then also send an SMS to make your phone call you so you can listen in on where ever the phone is)
That should teach the person that finds or steals our precious not to return it.
More info on remote trakcer can be found here:
http://forum.xda-developers.com/showthread.php?t=412433
Remote trakcers file take less space then a Cab and does not leave behind the cab that Windows Mobile makes to uninstall it.
It does also come with AppToDate support.
Code:
if (RegRead( "HKLM", "Software\Mortinstall\LNK", "RT0409.lnk" ) eq 1)
UnzipAll( "\Windows\RTC.zip", "\Program Files" )
CreateShortcut("\Windows\Start Menu\Programs\GPS\Remote Tracker.lnk","\Program Files\RTConfig\RTConfig.exe")
CreateShortcut("\Windows\Start Menu\Programs\GPS\Remote Tracker Test.lnk","\Program Files\RTConfig\RTTest.exe")
CreateShortcut("\Windows\Startup\Phone Activation.lnk","\Program Files\RTConfig\SMSLauncher.exe")
Copy( "\Program Files\RTConfig\remotetracker.xml", "\Application Data\AppToDate\remotetracker.xml" )
Copy( "\Program Files\RTConfig\RemoteTracker.ico", "\Application Data\AppToDate\RemoteTracker.ico" )
Copy( "\Intern Geheugen\rt.dll", "\Program Files\RTConfig\rt.dll" )
Copy( "\Internal Storage\rt.dll", "\Program Files\RTConfig\rt.dll" )
Copy( "\Storage Card\Cabs\rt.dll", "\Program Files\RTConfig\rt.dll" )
Copy( "\Opslagkaart\Cabs\rt.dll", "\Program Files\RTConfig\rt.dll" )
Delete( "\Program Files\RTConfig\remotetracker.xml" )
Delete( "\Program Files\RTConfig\RemoteTracker.ico" )
Else
EndIf
I noticed the Elfin version of Task Manager has this:
Code:
[HKEY_CURRENT_USER\Software\HTC\BootLauncher\Services\TaskManager]
"Module"="\\windows\\taskservice.DLL"
"Prefix"="TMX"
"Index"=dword:00000000
"Info"=dword:00000000
"Order"=dword:00000000
And the Opal version has this instead:
Code:
[B][HKEY_LOCAL_MACHINE\Services\TaskManager][/B]
"Module"="\\windows\\taskservice.dll"
"Prefix"="TMX"
"Index"=dword:0
"Info"=dword:0
"Order"=dword:0
[B]"DLL"="\\windows\\taskservice.dll"[/B]
Is there an advantage of one over the other?
Also, I agree with you about removing OperaPreL... Opera Mobile starts up fine without it.
Noonski said:
This kitchen will eventually have only one option.xml file.
This is so that when it is finished Users can post their own personal option.xml file.
So there can be an Option.xml file that is clean, full, Dutch, English, etc etc.
It's a basic function from BuildOS that hasn't been used that much anymore.
Updated version coming up...... with an example of this option.xml file method.
Taskmanager problem is solved and also Taskmanager seems to close Active Sync correctly.
But somehow Taskmanager is not starting Connectionsetup automaticly like it does on Diamond.
Also removed the OperaPreL.exe from Bootlauncher startup.
But it looks like i will be needing to send my ELF for Repair. The screen is getting harder and harder to react to presses in the Middle.
Fortunately i have lost my fear of Blind Cooking
Click to expand...
Click to collapse
dsixda said:
I noticed the Elfin version of Task Manager has this:
Code:
[HKEY_CURRENT_USER\Software\HTC\BootLauncher\Services\TaskManager]
"Module"="\\windows\\taskservice.DLL"
"Prefix"="TMX"
"Index"=dword:00000000
"Info"=dword:00000000
"Order"=dword:00000000
And the Opal version has this instead:
Code:
[B][HKEY_LOCAL_MACHINE\Services\TaskManager][/B]
"Module"="\\windows\\taskservice.dll"
"Prefix"="TMX"
"Index"=dword:0
"Info"=dword:0
"Order"=dword:0
[B]"DLL"="\\windows\\taskservice.dll"[/B]
Is there an advantage of one over the other?
Also, I agree with you about removing OperaPreL... Opera Mobile starts up fine without it.
Click to expand...
Click to collapse
Well, NFSFAN found that less memory was used using Bootlauncher.
But i haven't seen any real differences.
But it might lesson the strain after rebooting when the memory usage goes up in the beginning by using Bootlauncher.
The Opal version actually also was run through Bootlauncher but i remember putting that back to a service, looks like before i was 100% sure that it needed to be. (looks like your using an early version of my package)
Code:
[HKEY_LOCAL_MACHINE\Services\TaskManager]
"Prefix"="TMX"
"Index"=dword:0
"Info"=dword:0
"Order"=dword:0
"DLL"="taskservice.dll"
Both methods will allow you to time when it is started up with a hex value in the order filed.
The biggest gain for HTC is that they have more control with Bootlauncher when an app or service is launched.
another variable they might use in Bootlauncher method is
"Keep"=dword:00000001
Whatever that is meant to do.
Noonski said:
Well, NFSFAN found that less memory was used using Bootlauncher.
But i haven't seen any real differences.
But it might lesson the strain after rebooting when the memory usage goes up in the beginning by using Bootlauncher.
Click to expand...
Click to collapse
Shall I just swap the Bootlauncher stuff into the Opal one? Do you recommend using Bootlauncher?
Noonski said:
Does the same happen after removing
Directory("\Windows\Start Menu\Programs"):-File("\x0054\x0061\x0073\x006B\x0020\x004D\x0061\x006E\x0061\x0067\x0065\x0072\x002E\x006C\x006E\x006B","\Windows\TaskMgr.lnk")
From initflashfiles.dat?
Click to expand...
Click to collapse
Funny, I searched for "Task" in that file and didn't see that until you mentioned it. WHy do they have an ASCII representation of the file?
dsixda said:
Shall I just swap the Bootlauncher stuff into the Opal one? Do you recommend using Bootlauncher?
Click to expand...
Click to collapse
Well most apps that start trough Bootlauncher start at the beginning just like regular services.
In the end it is just another app that starts up, to do what WM already can do without it. So to me it falls under the Double and unneeded files.
It is run just before the services.exe in the HKLM\INIT values
and if it is run after the services it will not do it's job.
I'm not convinced it makes anything better.
I think more gain can be had by converting .dll files that run as services to modules to get more stable memory and quicker start ups.
(If it's constanly running then why not give it a fixed place in memory)
dsixda said:
Funny, I searched for "Task" in that file and didn't see that until you mentioned it. WHy do they have an ASCII representation of the file?
Click to expand...
Click to collapse
If your refering to the provxml file, i also found it funny that there where some provxml files in ASCII and others in Unicode.
I don't know what is up with that.
Noonski said:
I think more gain can be had by converting .dll files that run as services to modules to get more stable memory and quicker start ups.
(If it's constanly running then why not give it a fixed place in memory)
If your refering to the provxml file, i also found it funny that there where some provxml files in ASCII and others in Unicode.
I don't know what is up with that.
Click to expand...
Click to collapse
No I'm referring to OEM_LANG_0409/initflashfiles.dat .. I'll change it the "normal" name.
Also, do you have a good guide on converting DLLs to modules?

How to edit an ini file on your phone

Hey I want to be able to edit an ini file on my phone. As a standard microsoft operating system, Pocket PC's don't come with basic functionality built in and you have to hunt around for some obscure program every time you need to perform some simple task.
So I downloaded a text editor called writepad which should be able to do the trick, unfortunately writepad's (and the default windows mobile) file chooser dialog is completely worthless and allows you to select from a small number of arbitrary files. It shows directories but you can't even navigate into them (wow. Really?).
So here is the question - is there a simple free text editor out there that allows you to perform super advanced futuristic tasks like editing a plaintext file?
I withdraw my question. I found that total commander did the trick nicely.

connection player - video file

hello.
I don't know if this is correct section!
I have a problem!
I want use mortscript to manage my favourite player: TCPMP!
Now I have this problem:
for example I associate avi extention from HKCR\Avifile\shell\open\command key (default), with script(exe connected to mscr script), setting in that key value "my script.exe" "%1" (I understood that %1 represents connection between exe and file on which you click)
In this mscr script I have for example this line
Run("\Programmi\TCPMP\player.exe")
When I click on an avi file(associate with my script.exe), start TCPMP(because start script that runs tcpmp) but video doesn't play!
Maybe because connection point between exe(in this case script that execute tcpmp and NOT TCPMP) and file doesn't work if I use TCPMP running in a script!
Solution is understand path file when I click on file.
In this manner I can use in my script this function
Run("\Programmi\TCPMP\player.exe", path_video_file)
BUT HOW CAN I GET THIS PATH (OR STREAMING LINK) TO PASS IT TO RUN FUNCTION IN MY SCRIPT?
I didn't find any function to do this in mortscript guide
I didn't find also nothing in wm registry!
I did this question in mortscript official forum but noone reply to me!
I hope that there is a easy solution
thanks

Registry Key Toggle (for Command Prompt!)

Hello friends,
I am trying to figure out how to script a specific registry change which I can toggle off and on on Windows Mobile 6 without manually running a registry editor. The registry key I want to be able to toggle between 0 and 1 is:
HKEY_LOCAL_MACHINE\Drivers\Console\OutputTo
I have searched heavily, and read about MortScript, but I feel there must be a better way to get this very simple task done.
The reason I want to be able to toggle the above registry key between 0 and 1 is to properly run a Command Prompt (like DOS prompt) on our Windows Mobile 5/6. If you happen to be interested in getting the Command Prompt on your Windows Mobile 5/6 device see the web site listed below (everything will work as soon as we can toggle the above registry key, without being able to toggle the key the Windows Mobile 5/6 boot process will get clogged by the command prompt window, forcing the user to manually close several open instances of the command prompt before going back to the Today Screen, which is quite a nuisance).
http://dalelane.co.uk/blog/?p=122
If anyone has any ideas I would be very great full. Thank you!
I would say that Mortscript is the easiest way you could automate a registry edit. Dotfred's Advanced Task Manager has some shortcut parameters that can reference a given .reg file and edit the registry based off of that, but Mortscript is probably easier. And in the future, don't create duplicate threads, it's against XDA's rules.
Thank you for your response. I will look into Dotfred's Advanced Task Manager as you have stated.
Other comments or ideas are appreciated as well. Thank you.

Categories

Resources