MortScript examples accumulation

Search This thread
D

Deleted member 1890170

Guest
Microsoft stated here, the subkeys under HKLM\Drivers\USB\LoadClients for each USB driver have the form Group1_ID\Group2_ID\Group3_ID\DriverName. Each of the group identifier subkeys can be named Default to indicate that the USB device driver should be loaded if the remaining group identifier subkey names match the USB device. Otherwise, the group identifier subkey names are formed from combinations of vendor, device class, and protocol information, separated by underscores. This information comes from the USB device descriptor
You thanksfully demonstrated, the usb host drivers have variable length group ID entries, ex. "4817_4097","2800_26993_0","1133_49243_21504", and so on.

For me it seems to be unpossible to write a "generic" script, because you simply - at first glance - don't know which type of Group_ID the usb host driver sentence belongs to, means how to interpret the Group_ID sentence retrieved from registry.


If it's always Group_ID 1, then in any case is valid:

1. read in the Group_ID sentence
Code:
old_usb_driver=""
ForEach usb_driver In RegSubKeys("HKLM","Drivers\USB\LoadClients")
2. ignore all after 1st backslash, if any present
Code:
bs=Find(usb_driver,"\")
If(bs)
usb_driver=SubStr(usb_driver,1,(bs-1))
EndIf
3. split the Group_ID got at the underscore
Code:
vid_pid=Split(usb_driver,"_")
4. the 1st element then is the vender ID, the 2nd element then is the product ID
Code:
vid=vid_pid[1]
pid=vid_pid[2]
 
Last edited by a moderator:

nubail raja

Member
Feb 11, 2006
32
1
Help: Convert .xml file using Mortscript

Good day Mortscript experts!

Have been shuffling between my WM6.5 & Android NativeSD on my HD2 for a while now. I use WM6.5 predominantly & boot to Android solely for the purpose of using WhatsApp which is not available for WM.

My dilemma is that, during my intermittent use of Android I have accumulated several important SMSs and I'm unable to import those messages into my WM6.5 which I use predominantly.

The only solution I was able to identify after a prolonged search was to export the messages into .xml format using android application "Super Backup" found here play.google.com/store/apps/details?id=com.idea.backup.smscontacts & import it via SMSImport found here freewarepocketpc.net/ppc-download-smsimport-v1-0-1.html

The problem here is that both programs have different formats for the xml file & hence don't work. in order to make it work, the exported xml from android must be formatted to suit the WM import format

enclosing screenshots
Super Backup format exported from Android is as per enclosed screenshot 1

SMSImport format required for WM6.5 is as per enclosed screenshot 2

From what I understand the relevant data which are needed to be captured from Android xml format & converted to WM xml format are as follows

Android.xml wm6.5.xml

body = message
type "1" = inbox
type "2" = Sent Items
address = sender
time = date


I did find some reference to conversion in page 414 of this thread, but my expertise are very limited in this matter & humbly seek your expert help.

Can any of you experts please advice & help me with Mortscript code to convert the Android format to WM importable format.

Your kind help is highly appreciated & Thank thee in advance
 

Attachments

  • 1.png
    1.png
    50.1 KB · Views: 50
  • 2.png
    2.png
    49.6 KB · Views: 43
Last edited:

RoryB

Inactive Recognized Developer
Sep 4, 2008
2,921
766
Lexington
Good day Mortscript experts!

Have been shuffling between my WM6.5 & Android NativeSD on my HD2 for a while now. I use WM6.5 predominantly & boot to Android solely for the purpose of using WhatsApp which is not available for WM.

My dilemma is that, during my intermittent use of Android I have accumulated several important SMSs and I'm unable to import those messages into my WM6.5 which I use predominantly.

The only solution I was able to identify after a prolonged search was to export the messages into .xml format using android application "Super Backup" found here play.google.com/store/apps/details?id=com.idea.backup.smscontacts & import it via SMSImport found here freewarepocketpc.net/ppc-download-smsimport-v1-0-1.html

The problem here is that both programs have different formats for the xml file & hence don't work. in order to make it work, the exported xml from android must be formatted to suit the WM import format

enclosing screenshots
Super Backup format exported from Android is as per enclosed screenshot 1

SMSImport format required for WM6.5 is as per enclosed screenshot 2


From what I understand the relevant data which are needed to be captured from Android xml format & converted to WM xml format are as follows

Android.xml wm6.5.xml

body = message
type "1" = inbox
type "2" = Sent Items
address = sender
time = date


I did find some reference to conversion in page 414 of this thread, but my expertise are very limited in this matter & humbly seek your expert help.

Can any of you experts please advice & help me with Mortscript code to convert the Android format to WM importable format.

Your kind help is highly appreciated & Thank thee in advance

It seems all you need to do is set up a readfile operation that would then do a writefile operation. It would change the order of the parts you pull from the first file and use the different names like time versus date. You may have to read all type "1" and temporarily save them followed by all type "2"and temporarily save them. Then you would read/write the two temporary files into the final file. Most likely you could read the android file to extract only type "1" data and write it to the WM file, Then close the android file so you can reopen it and read it to extract only type "2" data and keep appending the the WM file.
Be sure to see the wiki for Mortscript
It has been a long time since I have written MortScript, so I wanted to first put the flow logic up here.
 
  • Like
Reactions: nubail raja
D

Deleted member 1890170

Guest
The problem here is that both programs have different formats for the xml file & hence don't work. in order to make it work, the exported xml from android must be formatted to suit the WM import format

enclosing screenshots
Was very hard for me to compare content of the screenshots. :)

Hence here the text versions of them

//
// format of Android's XML tag
<sms name="" service_center="" read="" body="message_text" type="" date="" time="" address=""/>
//
// format of WM's XML tag
<message recipient="" sender="" date="">message_text</message>


As RoryB already mentioned, you have to do both a ReadFile and a WriteFile operation. Only thougt as demo

Code:
mWM6.5LinesToImport=""
mAndroidExportedXML=ReadFile("Android Exported.xml")
If(mAndroidExportedXML NE "")
	mExportedLines=Split(mAndroidExportedXML,"/>^NL^")
	If(ElementCount(mExportedLines))
		mWM6.5LinesToImport&='<?xml version="1.0"?/>'
		mWM6.5LinesToImport&='^NL^<SMSExport>'
		mWM6.5LinesToImport&='^NL^<store name="SMS">'
		ForEach mExportedLine In Array(mExportedLines)
			If(Find(mExportedLine,'<sms name='))
				If(Find(mExportedLine,'type="1"'))
					mWM6.5LinesToImport&='^NL^<folder name="Inbox">'
				Else
					mWM6.5LinesToImport&='^NL^<folder name="Sent Items">'
				EndIf
				mWM6.5LinesToImport&='<^NL^<message recipent="'

				....

                                // extract message content
				mMessageBegin=Find(mExportedLine,'body="')
				mMessageEnd=Find(mExportedLine,'" type=')
				mMessage=SubStr(mExportedLine,(mMesageBegin+1),(mMessageEnd-1))

				....

				mWM6.5LinesToImport&='^NL^</message>'
				mWM6.5LinesToImport&='^NL^</folder>'
			EndIf
		EndForEach
		mWM6.5LinesToImport&='^NL^</store>'
		mWM6.5LinesToImport&='^NL^</SMSExport>'
	EndIf
	WriteFile("WM Import.xml",mWM6.5LinesToImport,0)
EndIf

This is not the complete MortScript code you need, of course.
 
Last edited by a moderator:
  • Like
Reactions: nubail raja

nubail raja

Member
Feb 11, 2006
32
1
Help: Convert .xml file using Mortscript

Jwoegerbauer & RoryB
Thank you Guys, both of you are amazing!! True to the legendary tradition of helpful XDA-Dev site & forum which is the true Bible for WM6.5 & it's illegitimate offspring (WP & Droid, Fox etc). Hats off to you!

I shall revert to you guys after fiddling & tinkering with the codes for a couple of days (why couple of days? started using windows since CE2 days & still a noob, village idiot I'm)

Jwoegerbauer : enclosing both the xml files for your reference & better comparison,

I also see there is no reference to file paths. pls clarify

Big Cheers guys!
 
Last edited:

nubail raja

Member
Feb 11, 2006
32
1
Help: Convert .xml file using Mortscript

Jwoegerbauer Hi
The script as it is throw me an error "mwm6 as unknown command, hence I replaced all mWM6.5 to mWM & it ran

The 1st output file WM Import.xml contained only the following:

<?xml version="1.0"?/>
<SMSExport>
<store name="SMS">
</store>
</SMSExport>


then I removed code If(Find(mExportedLine,'<sms name=')) as this info "sms name" is not required in Imported file

the script throw me an error expected "EndForEach" but found "EndIf" on Line 29

then I removed line 29, it ran & gave me an output file

The 2nd output file WM Import.xml contained only the following:

<?xml version="1.0"?/>
<SMSExport>
<store name="SMS">
<folder name="Inbox">< ; I see an extra character "<" after inbox
<message recipent=" ;typo, must spell as "message recipient" & the closing (") is missing
</message>
</folder>
</store>
</SMSExport>

made change to line 16 to correct the typo, removed character (<) before ^NL^ & added the closing (") as follow

mWMLinesToImport&='^NL^<message recipient=""'

not much of change. The 3rd output file WM Import.xml is as below:

<?xml version="1.0"?/>
<SMSExport>
<store name="SMS">
<folder name="Inbox">
<message recipient=""
</message>
</folder>
</store>
</SMSExport>

Sender, Date & Message is still missing in the output file. yet excited about the 1st baby step

Have no clue as to what next, will tinker further & update

Thanks & Have a great day ahead
 
D

Deleted member 1890170

Guest
Jwoegerbauer Hi


Sender, Date & Message is still missing in the output file. yet excited about the 1st baby step

Have no clue as to what next, will tinker further & update

Thanks & Have a great day ahead

You have overlooked, that you were told that the code sample shown is incomplete, is only a fragment: I showed this quick hack only to visualize how it could be done.

Can't occupy myself today with this. Family affairs, FIFA World Cup final, etc. Perhaps tomorrow, will see. So please be patient.
 
Last edited by a moderator:

nubail raja

Member
Feb 11, 2006
32
1
Of course no hurry Jwoegerbauer, please take your time. Enjoy the game & My best wishes for Germany in the Final!. Donkschee
 
Last edited:

nubail raja

Member
Feb 11, 2006
32
1
RoryB, unable to decipher the instructions. tried several times & failed. thanks any way

---------- Post added at 06:43 AM ---------- Previous post was at 06:40 AM ----------

Congratulations on Germany's world cup win Jwoegerbauer, it was the most thrilling game I ever saw! hope you enjoyed it with the Family, cheers!
 

RoryB

Inactive Recognized Developer
Sep 4, 2008
2,921
766
Lexington
Here is most all you want. You will need to write the code to fix the date format.
Code:
sp = SystemPath("ScriptPath")
SourceData = ReadFile( sp\"Android.xml") #reads your exported file
MainData = Split( SourceData, ">") #creates an array of each line from the exported file


MainDataIndex = 1
n=0
ForEach record in array(MainData)
#	message (Find(record, 'type="1"'))
	If(Find(record, 'type="1"') ne 0)
		  n = n + 1
		  Inbox[n] = record    
	EndIf
    MainDataIndex = MainDataIndex+1
EndForEach

MainDataIndex = 1
n=0
ForEach record in array(MainData)
#	message (Find(record, 'type="2"'))
	If(Find(record, 'type="2"') ne 0)
		  n = n + 1
		  Sentbox[n] = record    
	EndIf
    MainDataIndex = MainDataIndex+1
EndForEach

WriteFile('WM.xml','<SMSExport><store name="SMS"><folder name="Inbox">',  False)
ForEach xrecord in array(Inbox)
  If( xrecord NE "")
	WriteFile('WM.xml', '<message date=' & SubStr(xrecord, Find(xrecord, 'time=')+5, Find(xrecord, 'date=')-(Find(xrecord, 'time=')+5)), True)
    WriteFile('WM.xml', 'sender=' & SubStr(xrecord, Find(xrecord, 'address=')+8, Find(xrecord, 'time=')-(Find(xrecord, 'address=')+8)), True)
	WriteFile('WM.xml', 'recipient="">' & SubStr(xrecord, Find(xrecord, 'body=')+6, Find(xrecord, 'read=')-2-(Find(xrecord, 'body=')+6)) & '</message>', True)
  EndIf
EndForEach

WriteFile('WM.xml','</folder><folder name="Sent Items">',  True)
ForEach yrecord in array(Sentbox)
  If( yrecord NE "")
	WriteFile('WM.xml', '<message date=' & SubStr(yrecord, Find(yrecord, 'time=')+5, Find(yrecord, 'date=')-(Find(yrecord, 'time=')+5)), True)
    WriteFile('WM.xml', 'sender="" recipient=' & SubStr(yrecord, Find(yrecord, 'address=')+8, Find(yrecord, 'time=')-(Find(yrecord, 'address=')+8)), True)
	WriteFile('WM.xml', 'recipient="">' & SubStr(yrecord, Find(yrecord, 'body=')+6, Find(yrecord, 'read=')-2-(Find(yrecord, 'body=')+6)) & '</message>', True)
  EndIf
EndForEach
WriteFile('WM.xml','</folder></store></SMSExport>' & '^NL^',  True)
 
D

Deleted member 1890170

Guest
Here is most all you want.
You got me a lot of time saved :)
BTW: Programming style is different, only the result counts. Yes, programmers can use functions as parameters (or arguments) for other functions. In contrast to you, I never would pass as function argument a function with arguments

r=Function(x,Function(a,b))

this because it makes the code less readable than the sequence of

y=Function(a,b)
r=Function(x, y)

But as said: programming style is different.

You will need to write the code to fix the date format.
Unfortunately you can't use the date (i.e. timestamp) provided in Android's exported XML. For example: message's time is "Mar 22, 2014 8:01:44 PM", message's date is "1395518504000". If you treat message's date as an UNIX alike timestamp, it would convert to "Jan 19, 2028 03:14:07 AM"
 
Last edited by a moderator:

tito12

Senior Member
Feb 15, 2008
1,541
81
Tel Aviv
Hi guys, I hope someone is still reading this thread, nevertheless I'll try here.
My problem is to change the value of SkinName in an ini file

Code:
[Skin]
SkinFolder=\MD\WolfNCU\Skin
SkinName=skin2
BgndAutoChange=N
BgndChangeTime=10
Optimization=High

I have the script here to change SkinName value to skin1:

Code:
IniWrite( "MD\WolfNCU\WolfNCU.ini", "Skin", "SkinName", "skin1" )

But it doesn't, I'd be glad to know the answer if it is a syntax problem or not

Thanks
 

CLHatch

Senior Member
May 27, 2008
471
7
Nashville, TN
Hi guys, I hope someone is still reading this thread, nevertheless I'll try here.
My problem is to change the value of SkinName in an ini file

Code:
[Skin]
SkinFolder=\MD\WolfNCU\Skin
SkinName=skin2
BgndAutoChange=N
BgndChangeTime=10
Optimization=High

I have the script here to change SkinName value to skin1:

Code:
IniWrite( "MD\WolfNCU\WolfNCU.ini", "Skin", "SkinName", "skin1" )

But it doesn't, I'd be glad to know the answer if it is a syntax problem or not

Thanks

From what I remember, that is the correct syntax. But I'm going to guess the issue is the path, trying to write to the wrong file. Try including a backslash at the beginning as you did in the "SkinFolder" value:

Code:
IniWrite( "\MD\WolfNCU\WolfNCU.ini", "Skin", "SkinName", "skin1" )
 
  • Like
Reactions: tito12

tito12

Senior Member
Feb 15, 2008
1,541
81
Tel Aviv
Wow, didn't expect such a fast answer! Thank you, i'll try now :)

Edit: 1000 Thanks clhatch! It's working!!!
 
Last edited:

CLHatch

Senior Member
May 27, 2008
471
7
Nashville, TN
Wow, didn't expect such a fast answer! Thank you, i'll try now :)

If that doesn't do it, let me know... not used MortScript since I went to Android, but I used to do a LOT of scripting in it, including with INI files. I can look at my old scripts and try to figure out what's wrong. I could install it again on my computer also (there's a version for the PC) to test with.
 

germarc

Member
May 8, 2016
15
4
Rename file with date and time

Hi,
I have a file named testfile.txt created at 01.05.2016 12:15:06

How can I rename my file with created date and time with mortscript?

Example: 01052016_121506.txt

Thanks in advanced.
 
Last edited:

RoryB

Inactive Recognized Developer
Sep 4, 2008
2,921
766
Lexington
Hi,
I have a file named testfile.txt created at 01.05.2016 12:15:06

How can I rename my file with created date and time with mortscript?

Example: 01052016_121506.txt

Thanks in advanced.
From the manual.

To get file's modification time (last saved time)
9.14.6 Get file modification time (FileModifyTime)
int = FileModifyTime( file name )

Returns the last modification time of the file as unix timestamp, or 0 if the file doesn't exist.

See also 9.11 Time for informations about how to compare or format it.
and to convert that into the text strings you need.
9.11.2 Formatted output (FormatTime)
string = FormatTime( format [, timestamp ] )

Returns the time of the timestamp, or the current time if none is given, formatted corresponding to the format string.

These characters will be replaced with the corresponding value:
H Hour (00-23)
h Hour (01-12)
a am/pm
A AM/PM
i Minute (00-59)
s Seconds (00-59)
d Day (01-31)
m Month (01-12)
Y Year (4 digits)
y Year (2 digits)
w Day of week (0=Sunday to 6=Saturday)
u Unix timestamp
{MM}Month name (e.g. “January”)
{M} Month name abbreviated (e.g. “Jan”)
{WW}Day of week name (e.g. “Monday”)
{W} Day of week name abbreviated (e.g. “Mon”)

All other characters remain unchanged.

Note all return values will be strings. This is to allow leading zeroes, like "02" for february, which is handy to combine filenames. However, it might cause troubles when using arrays. You either need to assign the array elements with strings (“Month["01"] = "First"”) or convert the string to a number, e.g. by using “FormatTime("m")*1”.

Examples:
x = FormatTime( "h:i:s a" )
x = FormatTime( "m/d/Y", TimeStamp() + 86400 )
and then to rename your file.
9.12.3 Rename or move a single file (Rename)
Rename( source file, target file [, overwrite? ] )

Renames or moves a file.

You have to include the path in the target, too!

If overwrite? is FALSE or omitted, already existing files won't be overwritten.
 
  • Like
Reactions: germarc

germarc

Member
May 8, 2016
15
4
From the manual.
To get file's modification time (last saved time)
and to convert that into the text strings you need.and then to rename your file.

Many thanks for your help, finally I created the script.



Code:
#Get file modify time
int=FileModifyTime("TestFile.txt")

#Message with return value (only for test)
message (int)

#Convert time
FileModifyTime =FormatTime( "m-d-Y_H.i.s",TimeStamp()+86400 )

#Message with return value (only for test)
message (FileModifyTime)

#Prepare new file name
createTime = FileModifyTime&i&".txt"

#Rename TestFile.txt to date and time.
If (FileExists("TestFile.txt"))
     Rename ("TestFile.txt",createTime, 1)
EndIf

Best regards.
 
Last edited:

RoryB

Inactive Recognized Developer
Sep 4, 2008
2,921
766
Lexington
Some tweaks


Code:
#Get file modify time
int=FileModifyTime("TestFile.txt")

#Message with return value (only for test)
message (int)

#Convert time
FileModifyTime =FormatTime( "m-d-Y_H.i.s",int )

#Message with return value (only for test)
message (FileModifyTime)

#Prepare new file name
createTime = FileModifyTime&i&".txt"

#Rename TestFile.txt to date and time.
If (FileExists("TestFile.txt"))
     Rename ("TestFile.txt",createTime, 1)
EndIf
 
  • Like
Reactions: germarc

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    MortScripts to toggle settings

    Thread started today for MortScripts that can be used in CHTS. They started as a supplement to CHTS, but they can be used outside it too.

    So far I have radio band changer and sound profile changer scripts.

    MortScripts to toggle settings
    2
    D
    Deleted member 1890170
    fileMask="I*.jpg"
    startDir="\storage card\DCIM\100MEDIA"
    recurse=1

    @RenameFiles(startDir,fileMask,recurse)

    Sub RenameFiles(startDir,fileMask,recurse)
    Local()
    ForEach found In Files(startDir\fileMask)
    time=FormatTime("Ymd",FileModifyTime(found))
    name=FileBase(found)
    newFullFilePathName=FilePath(found)&"\"&SubStr(name,1,1,)&time&FileExt(found)
    Rename(found,newFullFilePathName)
    Sleep(1)
    EndForEach
    If(recurse)
    ForEach startDir2 In Directories(startDir\"*")
    @RenameFiles(startDir2,fileMask,recurse)
    EndForEach
    EndIf
    EndSub
    2
    D
    Deleted member 1890170
    Is anywhere a small graphic menu to get inspiration?
    By-look here: http://forum.xda-developers.com/showthread.php?t=1368340
    1
    Hello, I've a problem.

    I would want to create a script to set the registry of system of mine pna C220.
    In this way to every reset this script runs and in automatic configures the registry for me and launch my software preferred (pollicino).

    This is the script:
    Code:
    Errorlevel ("off")
    
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power", "DisableGwesPowerOff", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\ActivityTimers\UserActivity", "Timeout", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\ActivityTimers\SystemActivity", "Timeout", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\State\UserIdle", "Default", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\State\SystemIdle", "Default", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "BattSystemIdle", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "BattUserIdle", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "ACSystemIdle", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "ACUserIdle", "0")
    #RegWriteDWord ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "ACSuspend", "0")
    #RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "BattSuspend", "0")
    #RegWriteDword ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", "BatteryPoll", "0")
    
    #RegDeleteKey ("HKLM", "System\CurrentControlSet\Control\Power\ActivityTimers", True, True)
    #RegDeleteKey ("HKLM", "System\CurrentControlSet\Control\Power\State\SystemIdle", True, True)
    #RegDeleteKey ("HKLM", "System\CurrentControlSet\Control\Power\State\UserIdle", True, True)
    #RegDeleteKey ("HKLM", "System\CurrentControlSet\Control\Power\Timeouts", True, True)
    
    #SetVolume (255)
    
    Run("\Storage Card\Pollicino\Pollicino.exe")
    #Sleep (15000)
    Waitfor("Pollicino", 1000)
    while (WndActive ("Pollicino"))
    sleep(100)
    endwhile
    Kill("Pollicino.exe")
    
    
    Exit
    
    #*********************************************************************
    Is the script correct?

    Well, I have try to launch it but I have read this errore message:
    ".mscr and .mortrun extension registered.
    Please run any .mscr/.mortrun file ..."

    What's the problem? Is the Wrong script or other?

    I have set a button to launch this script:
    Code:
    ICONXPBUTTON
    X = 36
    Y = 71
    Command = \Storage Card\Pollicino.exe
    SizeNormal = 48
    SizePushed = 48
    Gray = no
    ScaleAlpha = 100
    IconNormal = \my flash disk\C220\skin\icons\Pollicino.ico
    Gray = no
    ScaleAlpha = 100
    IconPushed = \my flash disk\C220\skin\icons\Pollicino.ico

    In Storage Card I have:
    - Pollicino folder (inside Pollicino.exe)
    - Mosrtscript.exe (v.4.2)
    - Pollicino.exe (Mortscript.exe (v.4.2) renamed)
    - Pollicino.mscr
    - setup.dll
    - mortzip.dll

    Please help me

    Well, the script itself looks good, except you've commented out all your registry commands... take out the "#" from each line, if you actually want them to run.

    However, if you want to use an EXE file to launch a MortScript like you are trying to do, you don't rename MortScript.exe to Pollicino.exe, you rename Autorun.exe to Pollicino.exe. Also, you do not need setup.dll or mortzip.dll, those are if you are making a cab file.

    Although looking at it, you have the button launch \Storage Card\Pollicino.exe... is that supposed to be the one that launches the script? If so, the script needs to be in \Storage Card\Pollicino.mscr, and there should be \Storage Card\MortScript.exe there also (if it's not there, it looks for an installed version on your device). Better to have those in a folder, would think, and change the button launching to launch from the folder. I'm assuming that \Storage Card\Pollicino\Pollicino.exe is NOT supposed to be running a script, but some other program?

    Edit:
    It seems to me that this:
    Code:
    Run("\Storage Card\Pollicino\Pollicino.exe")
    #Sleep (15000)
    Waitfor("Pollicino", 1000)
    while (WndActive ("Pollicino"))
    sleep(100)
    endwhile
    Kill("Pollicino.exe")
    could most likely be changed to this:
    Code:
    RunWait("\Storage Card\Pollicino\Pollicino.exe")
    Assuming that the program closes itself, of course... Or do you want to have it killed when the window is no longer active?
    1
    I have done tinkered with PNA devices. Is the CE running on them the same as a PDA? I did a quick search and it seems to say the CE running on a PNA has limited access to CE functions. Maybe it does not allow wildcards as a result of this.