Batch file fails to xcopy outlook data

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Batch file fails to xcopy outlook data

Post by Gort9k »

Hola:
Surely I'm doing a stupid mistake, but I can not get this batch file working.
I found the backup file in this site, modified it to my needs and it seems to work fine except for the outlook part. The line in the .bat file that has got to do with outlook express reads like this:
%backupcmd% "%USERPROFILE%\Configuración local\Datos de programa\Identities" "%drive%\Outlook Express"
As you notice I've changed the name of the folders to suit my needs; but whenever I run this backup program it tells me that can not find Identities.
What am I doing wrong?
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

If you use Windows Explorer to navigate to the "Identities" dir, does it exist?

Post your entire batch file,
and what OS you're working in.
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Post by Gort9k »

I am using the backup file that I found in this site, modified it to suit my needs.
This is the .bat file:

@echo off
:: variables
set drive=d:\Backup
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

echo ### Guardando mis documentos...
%backupcmd% "%USERPROFILE%\Mis documentos" "%drive%\Mis documentos"

echo ### Guardando Favoritos...
%backupcmd% "%USERPROFILE%\Favoritos" "%drive%\Favoritos"

echo ### Guardando Correo y libreta de direcciones (Outlook Express)...
%backupcmd% "%USERPROFILE%\Datos de programa\Microsoft\Address Book" "%drive%\Address Book"
%backupcmd% "%USERPROFILE%\Configuración local\Datos de programa\Identities" "%drive%\Outlook Express"

echo ### Backing up the Registry...
if not exist "%drive%\Registry" mkdir "%drive%\Registry"
if exist "%drive%\Registry\regbackup.reg" del "%drive%\Registry\regbackup.reg"
regedit /e "%drive%\Registry\regbackup.reg"

echo ### Copiando directorios
%backupcmd% "c:\mbeur" "%drive%\mbeur"
:: use below syntax to backup other directories...
:: %backupcmd% "c:\mbeur" "%drive%\mbeur"

echo Backup Complete!
@pause

Everything works except the outlook part. I even tried to do a backup straight with this line:

xcopy "C:\Documents and Settings\Miguel\Configuración local\Datos de programa\Identities\{FF9082C5-4D15-4DFA-97C8-76FA3EDF4000}\Microsoft\Outlook Express" "d:\yyy" /e /y

But didn't work either. In this last case I got the Outlook Express file not found.

I'm using Windows XP pro, and yes, the folder Identities does exist.
Thanks
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

It looks good to me. Can't figure why it can't find Identities.

All I can think of (since I do not know the language you speak) is to check your spelling for the entire path to identities dir.
Navigate to the identities dir in Explorer, then copy/paste the path from the address bar. Might help 'if it is' a spelling mistake.
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Post by Gort9k »

Hi, norm:

Keep thinking that I've made a mistake, but I can not find it.
My native language is spanish (I beg you to excuse my bad english), so I changed the original batch file accordingly. Instead of Local Settings in spanish you read Configuración Local, and so on.
In order to avoid spelling mistakes I copied and pasted the entire address of the Outlook folder:
C:\Documents and Settings\Miguel\Configuración local\Datos de programa\Identities\{FF9082C5-4D15-4DFA-97C8-76FA3EDF4000}\Microsoft\Outlook Express
But to no avail, I keep getting the "Outlook Express folder not found" error....
Thanks
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

Hi again...


I'm assuming the batch file you're using is the one I wrote..
I stopped at the "Identities dir because I wasn't sure the "{FF9082C5-4D15-4DFA-97C8-76FA3EDF4000}" dir was the same for every user. Plus it includes all users OE files.

Instead of going all the way to Outlook Express in the path, try again to the Identies dir using the copy/paste method.

The ONLY other thing I can think of is that the "Local Settings dir is a hidden dir. Maybe you need to include an attrib command to "unhide" it and it's subfolders before the xcopy command.

btw - Your english needs absolutely no excusing, it's better than most english speaking members here. :thumb:
I would never have known you're Spanish.

Another thought came to mind as I considered the fact your system uses Spanish. maybe there are 'special' characters being used, and not recognized by the command interpreter (don't know, just a thought)
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Post by Gort9k »

I'm honoured to be talking to the creator of that batch file, no joking, I've found it to be real util.
Pity that Outlook Express matter...
As you suggest, I was giving thought to that special character question; it might be the answer to all of this.
As you know spanish language use some special characters, like the "ó" in the "Configuración local" folder. It could be that batch files get confused when they found that kind of characters as part of a folder name.
I'm going to try and see what comes out of this.
I shall post my findings.
Anyway, thanks for your help
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Post by Gort9k »

Hola:
It looks like the culprit was the"ó".
I've done a test trying to backup a folder with a special character in its name "c:\mía". But no matter how I tried, I always received the "folder not found" error message. Changin the name of the folder to "c:\mia" amended things.
So, now we know the reason of the fail.
My question, now, is:
Is there a way to make batch files recognize special characters?
Thanks
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

You could try going to Start>Run

Code: Select all

%systemroot%\hh.exe mk:@MSITStore: %systemroot%\help\ms-its:ntcmds.chm::/country.htm
That will take you to the Country command syntax page with some instructions on how to use it. I've never tried working with that command myself and can't be sure it will solve your problem.

It does state this:
"The country command configures the MS-DOS subsystem to recognize the character set and punctuation conventions observed when using one of the supported languages. Use the %systemroot%\System32\Config.nt file, or the equivalent startup file specified in a program's program information file (PIF), to load the Country/Region setting."

Good luck.

If that doesn't work out, you may be able to search the registry for that special character and replace it with something else, which in effect would change the character in each path that uses it.
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Post by Gort9k »

Hello:

I'm afraid that changing characters wouldn't do any good. As you know most of european languajes use them (ñ, é, ü, ç...). In spanish, for example, "qué" and "que" are different words, so we must use those characters.

I'm thinking of trying windows scripting languaje; no that I am proficient with it.

Anyway thanks for your help, and time.
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

You are welcome Gort9k. It's been a pleasure talking to you.
I hope you can find a solution one way or another.

Don't hesitate to ask if you have any further questions I can help with. :thumb:
See you around the forum


Norm
User avatar
Norm
SG VIP
Posts: 14195
Joined: Tue Mar 27, 2001 12:00 pm

Post by Norm »

I had a brainstorm. I just couldn't rest and leave you without a solution.
Dos rocks :)

Use the Dos path instead of the long name. Use the Dos truncated name.
The old 8.3 filename convention. Dos takes the first 6 characters, and adds ~1 ~2 etc depending on if there is more than one file or folder using the same 6 characters in the name.

eg:
"%USERPROFILE%\Configuración local\Datos de programa\Identities"

becomes

"%USERPROFILE%\Config~1\Datos de programa\Identities"


or all folders

"%USERPROFILE%\Config~1\Datosd~1\Identi~1" "%drive%\Outlook Express"


Using the Dos path takes care of the problem with special character in the long name (hopefully)

Let me know if it works for you.
nobugging
Member
Posts: 73
Joined: Sun Nov 26, 2006 6:23 pm

Post by nobugging »

use edit.com to create the .bat
Gort9k
Regular Member
Posts: 229
Joined: Wed Feb 28, 2001 12:00 am

Post by Gort9k »

Norm wrote:I had a brainstorm. I just couldn't rest and leave you without a solution.
Dos rocks :)

Use the Dos path instead of the long name. Use the Dos truncated name.
The old 8.3 filename convention. Dos takes the first 6 characters, and adds ~1 ~2 etc depending on if there is more than one file or folder using the same 6 characters in the name.

eg:
"%USERPROFILE%\Configuración local\Datos de programa\Identities"

becomes

"%USERPROFILE%\Config~1\Datos de programa\Identities"



or all folders

"%USERPROFILE%\Config~1\Datosd~1\Identi~1" "%drive%\Outlook Express"


Using the Dos path takes care of the problem with special character in the long name (hopefully)

Let me know if it works for you.
You were right, Norm.

Using DOS path did the trick. Now I can use xcopy at will.

Thanks a lot
Time Master
New Member
Posts: 1
Joined: Tue Jun 01, 2010 1:06 pm

Post by Time Master »

Norm wrote:I had a brainstorm. I just couldn't rest and leave you without a solution.
Dos rocks :)

Use the Dos path instead of the long name. Use the Dos truncated name.
The old 8.3 filename convention. Dos takes the first 6 characters, and adds ~1 ~2 etc depending on if there is more than one file or folder using the same 6 characters in the name.

eg:
"%USERPROFILE%\Configuración local\Datos de programa\Identities"

becomes

"%USERPROFILE%\Config~1\Datos de programa\Identities"


or all folders

"%USERPROFILE%\Config~1\Datosd~1\Identi~1" "%drive%\Outlook Express"


Using the Dos path takes care of the problem with special character in the long name (hopefully)

Let me know if it works for you.
Hey man, thanks a lot for this! You saved my life I was going mad :)
Post Reply