Solved

How can I do a file/folder copy in Windows CE 4.20 from the hard disk to an external location?

Posted on 2014-09-04
5
2,007 Views
Last Modified: 2014-09-14
I'm trying to write a batch file that will copy files from the hard disk of a machine running Windows CE 4.20.  This machine cannot be hooked up to a PC running Active Sync for a number of reasons.  It has access to a network location, as well as an external USB thumb drive.

I'm looking for a command to copy the entire hard disk to either a network location or thumb drive.  When I open Windows Explorer, it doesn't give me your typical c:, d:, etc. drive numbers.  It says \Hard Disk for the hard drive and \Network for the network location.

I'm familiar with the copy commands and wasn't sure if copy c:\*.* \network location would work or if I would need to specify the hard drive differently.  I'd also want this job to run on a schedule, like anytime the machine is rebooted or shut down.

Does anyone have any experience with creating this batch file?
0
Comment
Question by:jmchristy
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:hjgode
ID: 40306065
if this a 'good' CE build you will have access to the "net" command. With that you can map a shared folder on any server/pc in the same network to the device:
net use mappingname \\server_pc\sharename 

Open in new window

will map the share 'sharename' of 'server_pc' to '\network\mappingname' on the device. See http://msdn.microsoft.com/en-us/library/ms931463.aspx.

As most CE builds do not support the use of ip addresses for smb, you need to have a working WINS name resolution. You may also set the server_pc ip address as WINS entry in the network card of the device and then use the name 'server_pc'. This is a proven solution in a network without a dedicated WINS server.

The net use command also supports accepting a user name, password and domain for the shared access.

The other way around, connecting from a PC to the device is not supported.

Windows CE does not use any drive letters. So the external drive is mapped as \Harddisk or similar. This is like Unix does drive mapping.

You can test the connection to a share using the device's file explorer and selecting 'Go To' or entering the location manually (depends on the file explorer, is OEM dependent). Just enter the share host and name as you would on a PC. In example: "\\hostname\sharename".
0
 

Assisted Solution

by:jmchristy
jmchristy earned 0 total points
ID: 40310414
I was able to do the drive mapping with the net command - that wasn't an issue.

The issue was with developing a batch file to copy all of my files from the hard disk to a network location.

I did figure out that the following command line will work - but it's not copying any subfolders.  Any thoughts?

copy "hard disk"\Folder\*.* \\networkserver\sharedfolder
0
 
LVL 16

Accepted Solution

by:
hjgode earned 500 total points
ID: 40311216
The copy command was never able to copy sub directories. As there is no xcopy (AFAIK), you may use mortscript (http://forum.xda-developers.com/wiki/MortScript) or another scripting engine for wince to copy file recursively including sub folders, or write one yourself.
0
 

Author Comment

by:jmchristy
ID: 40311847
Thank you for confirming that with the copy command I will need to type each folder individually in my script.

Appreciate the help!
0
 

Author Closing Comment

by:jmchristy
ID: 40321499
My own comment provided the exact command for the copy from the hard disk.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
A short article about problems I had with the new location API and permissions in Marshmallow
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now