VBCE: The EmpFile Utility, A Hidden Gem!

Buried in the dark reaches of the Windows CE 2.0 emulator directory lies a little utility that some programmers may find very useful. The file is empfile.exe, located in the Windows directory of the emulator. This file is in the Windows NT directory for the emulator, not in the emulator file object store.

The empfile utility allows you to do several really neat things:

Synchronize a tree with the object store
Copy a file on the PC to a directory in the emulators file object store
Copy a file from the emulator file object store to the PC
Check to see if a file is in the emulators file object store
Delete a file from the emulator file object store
Run a file in the emulator object store
I recently found this very useful for installing a control into the emulator from my controls setup program. I also used it to register the control in the emulator by running the Windows CE RegSvrCe.exe.

The command line options for empfile are as follows:

-c SOURCE DEST ('put' or 'get' a file from object store)

-d FILE (delete a file on object store)

-e FILE (check to see if a file exists on object store)

-s (synchronize object store with wce\emul\PLATFORM\ tree)

-r MYAPP ARGS (run myapp.exe in the object store with arguments ARGS)

Here are some examples of some uses for this:

EMPFILE -s

(Synchronize wce\emul\PLATFORM\ tree with object store)

EMPFILE -c c:\test.exe wce:windows\test.exe

(Copy c:\test.exe to object store's Windows\ directory)

EMPFILE -c wce:test.exe c:\test.exe

(Copy test.exe from object store to c:\)

EMPFILE -e windows\text.exe

(verify that test.exe Exists in object store's Windows\directory)

EMPFILE -d test.txt

(Delete test.txt from object store root directory)

EMPFILE -r regsvrce.exe \windows\atlce.dll

(Run regsvrce.exe from object store with parameter "\Windows\AtlCe.Dll" to register the DLL)

Notes:

1) "PLATFORM" is the platform selected in the Emulation Settings dialog.

2) Wildcards (eg. '*.EXE') are not supported.

3) Specify the fully qualified path name for the Copy command.

Some applications for this might be to copy data files to and from the emulator for use with an application that you might be programming. It is also useful for installing controls into the emulator so that you do not need to do so manually with the Control Manager.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish