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,097 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

911 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

20 Experts available now in Live!

Get 1:1 Help Now