Batch file - Windows Mobile Development and Hacking General

Hi,
Is there something like a batch file for Windows Mobile 6 ?
I want to execute several EXE files via single command.
Problem description:
I want to turn off USB charging before executing WM5Storage, and then turn it on again after finished.
So, I was thinking of using something like a batch file in Windows command prompt.
@ECHO OFF
set_usb_charging.exe 0
wm5storage.exe
set_usb_charging.exe 1
The set_usb_charging.exe is an application that set a key in the registry to turn off USB charging.
Thanks for any help.

You can use the freeware program mortscript for that.

You can also use a Pocket CMD for it.
It works with .bat files.

gogol said:
Hi,
The set_usb_charging.exe is an application that set a key in the registry to turn off USB charging.
Click to expand...
Click to collapse
whoa, can you post that file?
i never knew its possible.

But what's the use of turning USB charging off? What if your WM5torage session is several hours...

I have not made that application yet, I am still busy reading .NET CF book + .NET step-by-step lol ...
Here is the registry key:
Try creating this:
Registry Key: HKLM\Drivers\BuiltIn\Usbfndrv\EnableUsbCharging
Value: 0 (to turn off) or 1 (to turn on)
shlomki said:
whoa, can you post that file?
i never knew its possible.
Click to expand...
Click to collapse

I have submitted a suggestion to Softick (the maker of Card Export) to add an option for this, but yeah, I am not sure if it will be implemented
For me personally, I am not sure if I will use WM5torage for hours ... what for?
Transferring 6 GB (my SDHC card) is not that long
I am now thinking of creating an application that will have:
- A checkbox "[ ] Disable USB Charging"
- A button "[ Launch WM5torage ]" , then use something like "system()" or shell execute to launch the WM5torage.exe
But as I said, I am still busy reading the books !
Poor me, the only Win32 language that I know is Delphi 7
PS: Btw, I successfully create the "Hello World" using .NET CF 2.0 ... lol !!!
Maggy said:
But what's the use of turning USB charging off? What if your WM5torage session is several hours...
Click to expand...
Click to collapse

Lots of people use portable apps nowadays. You install Office, Photoshop, whatever on your USB stick, it instantly runs on any computer and writes all data only to your USB stick. So yes, a USB stick session or in this case a WM5torage session can take all day.
You've still not aswered my question WHY oh why oh why do you want to turn charging off???
BTW I'd never use dot net to write something simple like this.
In mortscript it's as easy as
write reg key 1
start wm5torage
wait till it ends
write reg key 2
exit
(free translation but actually your script would look much like this)

Well, like I said, that is just me ... I will not run anything via USB stick.
Mostly, I will use USB storage mode to transfer large files, movies, etc.
Or when ActiveSync is not available (for small files).
And why I want to "have option" to turn off USB charging when using USB storage mode? Simply 2 reasons:
1. I dont want to drain the laptop battery when it is also not connected to the power source (to preserve the laptop battery).
2. I dont want to initiate battery charging in short time quite often, because I will only charge the battery if I have enough time to charge it until 100%. I found this a good way to preserve the performance of the battery.
People tend to disagree with reason 2. But having this option will give you more choice when you are in situation like option 1.
Again, I tend to create this as an option, you may or may not activate USB charging when using USB storage mode
Mortscript is one option, thanks for that.
But I also want to learn this WM coding thingie
Hope that explain my thought and goal ...

Maggy said:
You've still not aswered my question WHY oh why oh why do you want to turn charging off???
Click to expand...
Click to collapse
USB charging seriously drains my laptop battery. With Ultra Low Voltage devices every little bit counts. Turning off USB charging would save me almost an hours worth of battery on a full charge.
fluxist

for me its mainly reason 2.
usually i only need to transfer something quickly, and then unplug.
i don't want the battery to charge for just a minute, as it seems not quite healthy for the battery life, thats it.
BTW, the reg doesn't work for me.
when plugging in the pc, orange light turns on and charging starts... tried to softreset - same result.

I found another registry key which is working fine with my HTC Kaiser (Windows 6 Pro device).
HKLM\\Drivers\BuiltIn\Battery\EnableUSBCharging
if EnableUSBCharging = 1 --> Phone will be charged when connected to a USB power (laptop, etc.)
if EnableUSBCharging = 0 --> Phone will not be changed
I just did a test :
- Unplug PPC from USB cable
- Set the above registry to 0
- Plug PPC to the USB cable
I saw it did not charge the battery
- Unplug PPC from USB cable
- Set the above registry to 1
- Plug PPC to USB cable
I saw it was charging the battery
So, that registry key works At least in my HTC Kaiser !
shlomki said:
for me its mainly reason 2.
usually i only need to transfer something quickly, and then unplug.
i don't want the battery to charge for just a minute, as it seems not quite healthy for the battery life, thats it.
BTW, the reg doesn't work for me.
when plugging in the pc, orange light turns on and charging starts... tried to softreset - same result.
Click to expand...
Click to collapse

I've got a same issue...
When I listen to music I hear sound threw my speaker and headset. Is it possible to hear it only from the headset?
The registry key when the headset is connected:
HKLM:/system/state/hardware/headset dword @ 1
Disconnected:
HKLM:/system/state/hardware/headset dword @ 0
Whats the registry key for the speaker?
*ontopic
I think this is very useful for the battery life. It's useless to charge the battery for a minute!

Ok, thanks for the suggestion to use MortScript
It works!
Here is the script that I use to start Softick Card Export II without USB Charging.
Code:
v = RegRead("HKLM", "Drivers\BuiltIn\Battery", "EnableUSBCharging")
RegWriteDWord("HKLM", "Drivers\BuiltIn\Battery", "EnableUSBCharging", 0)
SleepMessage(5, "Disabling USB Charging ...", "Wait")
RunWait("\Program Files\Softick\Card Export II\CardExport.exe")
SleepMessage(3, "Setting back USB Charging ...", "Wait")
RegWriteDWord("HKLM", "Drivers\BuiltIn\Battery", "EnableUSBCharging", v)

Related

Toggle USB Charging

Hi All,
can anyone make a software to toggle usb charging? half the time my phone is connected to the usb for syncing but i dont want it to stuff up the battery since it charges it to full in about 3 hrs and i stay in office longer than that. would be good for the battery to be able to switch it off once in a while.
thank you
I know there's a reg key that can do what you said, depending on your device. I guess an app would be as simple as toggling that reg key. You can do it in mortscript or skschema.
But if you got a phone like Trinity that I own, then you are out of luck

[Q] Help! My focus won't recognize that it's connected to a USB

Hi everyone,
Recently, I tried to get my phone to tether using these directions: (can't post the link yet, but these directions are kind of universal)
2-On the phone, go to keypad and dial ##634#, then press the [Call] button.
3- A diagnostic mode screen in gray will show up.
4- Dial *#7284#, and press the [Call] button.
5- A Microsoft USB Test screen will show up which allows configuration of USB Path Control settings (options available is Zune Sync; Modem, Tethered Call; and Modem, USB Diag).
6- Select Modem, Tethered Call.
7- The phone will automatically restart to activate the setting.
8- Connect the phone to PC with a USB cable.
..and so on and so forth
However, when I tried to put it back to the zune/sync, it wouldn't work. I go back to the menu where it gives me the three choices of zune; tethering; and USB modem, and it shows that the phone is on the Zune sync option. However, when I plug in the USB cable into it, the computer doesn't recognize it - there's no charging involved, and the zune software doesn't open.
Additionally, when I try charging it to the plug that came with the package, the phone doesn't recognize that it's connected to that either and it still doesn't charge. Does anyone know what the issue is here?
I've tried multiple times to go back to the Path Control Settings menu and switch it to Zune Sync but nothing is happening to remedy the situation. Any pointers?
Any help would be greatly appreciated.
Thanks in advance!
A long shot but did you by chance set the Zune software to sync wireless ? You may need to set it to No or turn off wirless Sync.
Settings>Phone>Wireless Sync
Make sure your phone is connected and sign into Zune. Again only a long shot.
I'm 99.9% sure I didn't set it to wireless sync. I turned off the wireless on my phone to conserve battery as well.
Also, in order to check the wireless sync setting I need to connect my phone, which I have, but the computer nor the phone has registered the connection. (No sound made on either end, and the battery charge icon isn't showing)
Thanks though! A long shot is still a shot!
edit: FYI, I'm running Windows 7 64-bit. I'm not sure if that had anything to do with mucking up my phone as it did...
This sounds pretty strange. I have been changing from Modem to Zune back and forth and no problems at all.
I guess a Hard Reset will do the job for you. But I am not completely sure. Good luck.
ninjatengu said:
Additionally, when I try charging it to the plug that came with the package, the phone doesn't recognize that it's connected to that either and it still doesn't charge. Does anyone know what the issue is here
Click to expand...
Click to collapse
Do I understand correctly that you cannot charge the phone with the wall charger?
If that's the case, it's probably an issue with your cord or the mini usb port.
Did you make any other changes while in Diagnostic mode? If you're not sure, check out this thread.
Do I understand correctly that you cannot charge the phone with the wall charger?
Click to expand...
Click to collapse
Yes, you understood correctly. I cannot charge the phone with the wall charger. It's the charger that came with it, so it's the charger that has a USB port. I've also tried using different USB cords unsuccessfully. :-/
I haven't made any other changes while in Diagnostic mode.
A hard reset is a last resort. Although I'd still want to figure out why it happened as opposed to just figuring out how to fix it to prevent something like this in the future.
Thanks guys!
ninjatengu said:
Yes, you understood correctly. I cannot charge the phone with the wall charger. It's the charger that came with it, so it's the charger that has a USB port. I've also tried using different USB cords unsuccessfully. :-/
I haven't made any other changes while in Diagnostic mode.
A hard reset is a last resort. Although I'd still want to figure out why it happened as opposed to just figuring out how to fix it to prevent something like this in the future.
Thanks guys!
Click to expand...
Click to collapse
I think the mini USB socket on your phone may be defective. Fortunately, the setup following a hard reset isn't nearly the task it was on WM...
So I tried a hard reset, and the thing still didn't work.
I'm assuming this is a hardware problem. Thankfully AT&T has the whole 30 day exchange thing going on.
They couldn't fix it there, so they did exchange it for a new one. The new one works. So yay!
Thanks for all your input peoples!

[Q] Have you seen this in your DVP?

I was playing with the way i plug the DVP to my computer. Only difference this time i was using a external powered USB hub which is then connected to PC. While doing so, the DVP re-booted and came to this screen. Has any one come across this?
View attachment 498186
I have seen that once after plugging into the supplied ac adapter when my battery was almost dead. I think it happens when the phone thinks the battery is dead.
nvr seen it. what di dyou do?
Its so weired I was unplugging and plugging back in a few times to see if it does again - it did actually. Then i was confusing this symbol with USB composite mode and started researching online. Then all of a sudden, zune opened up and all back to normal again.
I believe this only happens when there is a dead battery. It turns the phone on because it has to be powered on to charge properly but there is not enough power in the battery to run the os. It then allows a short charge cycle, then restarts and loads everything. That has been my experience with seeing that symbol. If you plug in the phone with a dead battery and try to turn the phone on, it will load this symbol until it charges for a few minutes, then it will allow you to turn it on.
I believe that symbol means its charging, and it doesn't yet have enough power to fully turn on. USB provides less power than a wall outlet, so it can't fully run off of a USB power source.
Thanks for the replies folks. For a moment, i thought we are onto something
But at-least this made me research and dig for any clues on my pc.
I was looking at the event log and error logs and came across a reference to VHD (Virtual Hard Drive). But, i am not sure if phone is set as a VHD and accessed by zune or its the emulator doing it. If you have WP7 development tools installed, do a search on your pc for '.vhd', you will come across one called '....NandFlash.vhd'. This will show up if you happen to have developed some app and done a run via the Visual Studio WP7 emulator. I did try to mount that VHD and it isn't allowing me.
When i looked at that file in Textpad/notepad/wordpad, it has many a info (registry and user info,etc). But, with my limited knowledge can't figure much.
Yea, you get that screen when you're phone is dead and trying to recharge. Also if you don't turn on the phone while charging, you can slide your DVP up. This will allow you to see the keyboard flashing to let you know it's charging. I don't know if anyone else found that but that's what it did for my DVP.

[Q] PC won't recognize my Omnia 7 (HELP)

Hello every one,
When I plug my Omnia 7 with my laptop, it appears the message "USB Device Not Recognized. Unknown Device (Code 43)." I have tried different ways posted in this forum but non of those worked. I tried to restart my pc, plug off battery, hard format my phone, tried in different laptops, and the other methods, but non of those worked.
I need help please if anyone could tell me what to do I would appreciate.
Try reinstalling zune, maybe even reinstalling sammy usb drivers.
Sent from my OMNIA7 using XDA Windows Phone 7 App
I have to say .... we can spend hours understanding these windows phone
I do not know why a windows phone cannot be synced with a windows computer. Am having the same problem. My device appears as unknown device in Device Manager. I tried to update the drivers from Zune folder, but it does not find the correct drivers there. Any help would be so appreciated.
Thanks a lot.
i had the same problem in my omnia 7 very recently.
followed the below steps now it si working
Reset the phone
Restored the back up i had (older version)
upgraded to latest version 7.10 (8773)
worked fine for some time. Now i am facing another problem, if i remove charger/usb cable, it behaves like Cable is connected and Disconnected continuosly
Shows charging icon (even if cable is removed), and notification sound coming continuosly,
as of now i am living with it in Vibration mode
Fitimm said:
Hello every one,
When I plug my Omnia 7 with my laptop, it appears the message "USB Device Not Recognized. Unknown Device (Code 43)." I have tried different ways posted in this forum but non of those worked. I tried to restart my pc, plug off battery, hard format my phone, tried in different laptops, and the other methods, but non of those worked.
I need help please if anyone could tell me what to do I would appreciate.
Click to expand...
Click to collapse
I have the same problem, if someone finds a solution please keep me informed too. Thanks in advance
All you can do is to cross your fingers and pray
Cause mine started working one day out of no where .... so i think with MicroSoft products, everyithing is based on pure luck
I think I can help - it may be the BATTERY!
Hi - I stumbled on this thread by accident but had a very similar problem - I will look up the Whirlpool thread where I wrote about it as it was a while ago - but similar symtoms all fixed by replacing battery. _ i dropped my Ominia briefly into water.
Here's what I wrote in Whirlpool forum on 2011-Oct-31 (can't post link as new member) Thread Title "Samsung Omnia 7 i8700 - Part 2"
My beloved Omnia 7 took a very quick dip in the pool on the weekend. Life lesson learnt: "Do not put phone in top pocket as it will fall out."
Anyhow I grabbed it straight away and turned it off – dried it off etc – I was amazed it booted and runs BUT things are not good.
� Phone works normally (all functions, wifi, apps, OS etc.) on external charge either AC or PC USB
� Phone works normally on battery, but it keeps playing an alert chime, will not sleep, and in Settings / Battery Saver it flashes on this screen � and it does not sleep as whatever it�s alerting on prevents idle.
� Goes to sleep when on AC/USB charge.
� After plugging into AC/USB, and unplugging from AC/USB, phone runs normally, believes it is being charged, does not play alert chime, but does not sleep
� Does not interface with PC via USB � plug into USB causes �USB Device not recognised� (tried different cables/PC�s)
� Does enter download mode, but USB not available.
At a long shot, it may be the battery. I know I could buy online (risk it won't be the issue). All I need to do is a quick battery swap test but need a spare battery.
WHAT A MESS. Let me know if you are a Brisso and wouldn't mind sharing your battery for 5 mins....
If replacing battery fixes the problem then GOD knows what Engineering Samsung/Microsoft is upto
� Phone works normally (all functions, wifi, apps, OS etc.) on external charge either AC or PC USB
� Phone works normally on battery, but it keeps playing an alert chime, will not sleep, and in Settings / Battery Saver it flashes on this screen � and it does not sleep as whatever it�s alerting on prevents idle.
� Goes to sleep when on AC/USB charge.
� After plugging into AC/USB, and unplugging from AC/USB, phone runs normally, believes it is being charged, does not play alert chime, but does not sleep
� Does not interface with PC via USB � plug into USB causes �USB Device not recognised� (tried different cables/PC�s)
� Does enter download mode, but USB not available.
At a long shot, it may be the battery. I know I could buy online (risk it won't be the issue). All I need to do is a quick battery swap test but need a spare battery.
WHAT A MESS. Let me know if you are a Brisso and wouldn't mind sharing your battery for 5 mins....
Click to expand...
Click to collapse
I had the same prob here and windows can not recognize my Omnia 7 any more after it caught rain.
I had the same problem on my Windows 7 (64 Bit)
Unknown usb Device , lot of posts have found and at the end it was USB-Cable !!!
The problem was in the length of the cable, with long (1m cable) i can flash but no connection over Zune, after i take cable from my Nokia 15 cm short cable it works without any problems.
misko2k said:
I had the same problem on my Windows 7 (64 Bit)
Unknown usb Device , lot of posts have found and at the end it was USB-Cable !!!
The problem was in the length of the cable, with long (1m cable) i can flash but no connection over Zune, after i take cable from my Nokia 15 cm short cable it works without any problems.
Click to expand...
Click to collapse
I tried all cables, SS, Noikia, Kindle... none worked
What Windows are you using, do you have original ROM on your Omnia ?
For example if you are using some other rom than original , that there you have changed settings for USB port (In Diagnose Mode you can check this)
I am on original German T-Mobile ROM, exact same issue, no cure for now. Looks like an end of life for old good Omnia ...
But I did force update both 8112 and 8773 yet before ZUNE actually suggested the update .So not really in a position to complain.
But if anybody here did a "fully legal" ZUNE update (no flash no forced) then it means that the update itself is a problem and MS / SAMSUNG are responsible (not that it ever changed). Did anyone on OEM ROM with the issue upgrade in a fully clean way ?
Just now noticed - this is similar to the problems mentioned in another 2 threads hot here - just in another case people experienced only annoying "alert ringing". Looks like some of us get hit more severe, others less. XDA gurus - PLEASE spend time on this ! This looks as a massive desease case, last hope is XDA.
http://forum.xda-developers.com/showthread.php?t=1756990
http://forum.xda-developers.com/showthread.php?t=1761402
UPDATE : after all, this was not software related issue. USB port got rust, 70$ to replace it - all troubles gone, connects to PC and no alarm.
Fitimm said:
Hello every one,
When I plug my Omnia 7 with my laptop, it appears the message "USB Device Not Recognized. Unknown Device (Code 43)." I have tried different ways posted in this forum but non of those worked. I tried to restart my pc, plug off battery, hard format my phone, tried in different laptops, and the other methods, but non of those worked.
I need help please if anyone could tell me what to do I would appreciate.
Click to expand...
Click to collapse
to connect tour omnia W to pc, download latest zune softwRE
Now go th your phone dialer and dial ##634#
wait for some time....another dialer screan will appear.....now dial *#7284#
Now select Modem,tethered call(may be second option )
Your phone will restart
Now connect your phone thru data cable............

[Q] Charging Problem

Hi
Recently i've bought this Htc Hd mini.It wasn't new.
Now, my problem is that the phone is charging only when the phone is off.
Could someone help me?
Welcome to HTC HD MINI Forum!
-Witch ROM are you using ?
-Have you tried Hard Reset?
-Do you use the original charging kit?
-How long does the battery last?
bas.bas said:
Welcome to HTC HD MINI Forum!
-Witch ROM are you using ?
-Have you tried Hard Reset?
-Do you use the original charging kit?
-How long does the battery last?
Click to expand...
Click to collapse
-I was using the original wm, but now i've flashed android with sense 3.5.
-No
-No, i used the usb cable and nokia charging kit.
-Not so much it can't take a day.
Also i can hear a strange noise coming from the charging kit. when it's plugged in. Could be an hardware error or software?
Better not do hard reset on the Android, can not help but bring you trouble ... to the charge I had the same case on CM 7.2, after a few reboot is to be changed do not know what the problem was, the developers are working on it, read forum you will find lots of information about
"i can hear a strange noise coming from the charging kit"
I would not use it, it is safer to be charged via USB cable.
bas.bas said:
Better not do hard reset on the Android, can not help but bring you trouble ... to the charge I had the same case on CM 7.2, after a few reboot is to be changed do not know what the problem was, the developers are working on it, read forum you will find lots of information about
"i can hear a strange noise coming from the charging kit"
I would not use it, it is safer to be charged via USB cable.
Click to expand...
Click to collapse
Thx for reply. I don't think it's an android ROM problem. I had the same problem when i still used the wm 6.5
here's a solution
Flash Back to Wi-Mo and Check Setings\System\Power\Battery -Do not charge the battery if the phone is switched on and connected to a PC.
How do you know, that the phone is not charging?
The state of the LED (red/green/off) is changed by software (WM/Android), if the device is turned on, while the charging itself is controlled by hardware only.
You should check, if the phone is really not charging, while its turned on. Just ignore the charging LED and monitor the charging state of the battery after an hour, after you started with an almost empty one.
Best regards
@stahlnase, you're right when it comes to Android, but (windows phones) have software to control the charging. Something else;although we have through the nand installation erased entire phone, there are still some Wi-Mo "things" in this case battery setting or GPS was also associated with a Win-Mo settings. Regards!
I'm still not convinced, that the battery doesn't get recharged, just because the LED is not on
But you made an important point about enabling charging, while being connected to PC. Since demian12 is not using the HTC USB power supply, the device might "think" it is connected to a PC instead on a pure USB recharger. I believe, there are differences in the wiring of USB connectors to determine, if its a power and data plug or power supply only.
Regards.
can't flash back to wm.
I can't flash back to wm.
I have a sanddisk micro sd but is locked with a password unknown and at the second method i can't find a rom suitable for my phone.Error 294.
I can provide only this info:
IMEI:357215036311986
S/N: SH09FPZ00227
P\N: 99HKN017-00 F
Thanks for help
Ps:i tried that thing. I tried to charge it with low battery but it only keeps restarting.So i have to let it off a few minutes then charge it when it have at least 10% on the indicator.
see this for the original rom
http://forum.xda-developers.com/showthread.php?t=1644182
and this is to charge the battery
http://forum.xda-developers.com/showpost.php?p=24920088&postcount=10
another problem
Ok, i've flashed the original wm 6.5 greek rom.
After that, my phone won't charge at all.It shows a solid orange light for 3 seconds then it starts blinking.
I can start my phone but it closed soon, after wm boot.
Because your battery is completely empty ... it is necessary to leave some time (5-10 min) to charge, ignore charging indicator, the battery is charging! After ten minutes put the battery out / in and start a Phone.
Go to: Setings \ System \ Power \ Battery.
And Unselect option: -Do not charge the battery if the phone is switched on and connected to a PC.
Done
all night
bas.bas said:
Because your battery is completely empty ... it is necessary to leave some time (5-10 min) to charge, ignore charging indicator, the battery is charging! After ten minutes put the battery out / in and start a Phone.
Go to: Setings \ System \ Power \ Battery.
And Unselect option: -Do not charge the battery if the phone is switched on and connected to a PC.
Done
Click to expand...
Click to collapse
I left it a whole night and nothing happened! Seems like i must replace the battery.
Thanks for the help
hello
Still me, new info
I tried with another battery.Surprize my phone shows that, that one is empty too.
Strange isn't it?
Any ideea?
If you have a good HTC charger and battery doesn't charge after you reseted windows to factory default, then your problem is hardware related.
Of course I have some ideas, but do not have time until Monday to deal with anything. Sorry. I have a suspicion that Nokia charger burned your phone. Of course, should be checked, maybe is a bug in the Android battery driver, and with the help of a trick to make the jump and put everything into place. either way, do not give up, try again and again to turn on your phone.
re
bas.bas said:
Of course I have some ideas, but do not have time until Monday to deal with anything. Sorry. I have a suspicion that Nokia charger burned your phone. Of course, should be checked, maybe is a bug in the Android battery driver, and with the help of a trick to make the jump and put everything into place. either way, do not give up, try again and again to turn on your phone.
Click to expand...
Click to collapse
I was very fast so I could run Haret, before it shut down.I've installed Android on it again.I don't know what to say till now.If I put it at usb my phone stays awake, but the battery indicator does't raise. It shows my that is charging but...anyway is batter than completly dead.
Thanks to all

Categories

Resources