What type of file is created when done thru CMD file

I created the following batch file to run on a daily basis thats send me an email with an attached file, One email goes to my blackbery email address and the other goes to my personal email
When I get the email on my personal desktop email on my blackberry cell I can not open the attachement I get this message (unable to retrieve) Now on the blackberry cell when I get the email to my blackberry email address I have no problem opening the attachment.

I can open attachments like photos work docs spreadsheets no problem on my blackberry desktop email (my personal email account)

The problem is the file I am creating using this batch file is having the issue. It is a .txt file

I haave sent myself other .txt (notepad) files and had no problem

I run this on a Windows 2003 R2 Enterprise 64bit SP2 Server

Use a batch utility febooti which send the email using smtp

I even ran from a command prompt using febooti with an txt file and it worked

Again only the ,txt file that is create from the followin batch file I can not open

Here is the cmd file

del c:\util\*.log
del c:\util\report.txt
del c:\util\reportA.txt
xcopy "C:\Documents and Settings\Administrator.ABC\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\*.log" c:\util
dir c:\util\*.log /b /od >c:\util\ordered.txt
echo %date% >c:\util\copylogx.txt
echo %time% >>c:\util\copylogx.txt
type c:\util\copylog.txt >>c:\util\copylogx.txt
for /f "skip=9" %%1 IN (ordered.txt) do rename %%1 current.log

rem current.log is Unicode, so won't go in a text message
type c:\util\current.log >c:\util\%dtt%.log
type c:\util\current.log >c:\util\report.txt
rem above converts current.log from Unicode to ascii

copy c:\util\current.log c:\util\reportA.txt /A

xcopy %dtt%.log "C:\Documents and Settings\Administrator.ABC\Desktop\Support Files\Backuplogs\"

rem Send email with status of job
c:\util\febooti\febootimail -from testuser@tabc.com -to mycelll@vzw.blackberry.net -msg "Open attachment for Report" -subj "Server Weekly Backup" -attach report.txt -smtp 192.1681.26

c:\util\febooti\febootimail -from testuser@abc.com -to desktop@abc.com -msg "Open attachment for Report" -subj " Server Weekly Backup" -attach reportA.txt -smtp

rem delete *.bkf files older than 21 days
forfiles /p "D:\Server Backup\Server" /m *.bkf /d -21 /c "cmd /c del @path"

del c:\util\ordered.txt
del c:\util\copylogx.txt


I have tried different options on the copy command /A /R  no luck

One more thing I have the sma eproblem when using a PS1 file that creates a .txt output file can not up the aattachment

Any ideas or thoughts

Who is Participating?
InserachofConnect With a Mentor Author Commented:
I just got off the phone with blackberry support

After several tests I can open attachements they sent me

So I did this test next

I copied mailboxesA.txt to another machine and using outlook I sent my desktop email icon on my cell an email with the attachement and I was able to open the attachment

So I am now thinking it has to be febooti

Sent them a support request lets see what they come up with
sjklein42Connect With a Mentor Commented:
Try updating to Febooti Version 4.0 (released Jan 24,2011).  The content MIME type of email attachments is now specified more precisely.
InserachofAuthor Commented:
I updated to version 4.0 but the same thing happens still cant open the attachments

It has to be the way the file is created but I am not sure
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

sjklein42Connect With a Mentor Commented:
Even though TYPE has been successfuly used to convert to ASCII or Unicode on many computers, it has been reported to fail occasionally.

Not sure if this will work any better, but try "COPY /A" instead of TYPE, as in:

copy /a c:\util\current.log c:\util\report.txt

I see you already use COPY /A for the reportA.txt file.  Does reportA.txt attachment work right or not?
InserachofAuthor Commented:
No it does not work  I tryied Copy ./A and Copy /R  no luck

I thought maybe using PS1 instead of the cmd file but that does not help either
sjklein42Connect With a Mentor Commented:
A couple things.  First, if you can post the "bad" report.txt file as an attachment to this question that might give us something else to look at.

Found another interesting link:  http://benzcode.blogspot.com/2008/08/convert-easily-unicode-file-to-ascii.html.  The following idea comes from that page:

If you do a "CHCP" in a DOS command window (I didn't even know about that command), what is your current codepage setting?  Maybe it's not the default (437 on my machine.)  You can try this sequence of commands to see if it makes a difference:

CHCP 1252
TYPE c:\util\current.log c:\util\report.txt

Open in new window

1252 is the most commonly used codepage for western languages in Windows 2000 and later.
Use a different code page for other languages.
In Windows 9x use 437 (US) or 850 (Europe).

Note: To save and restore the original codepage, use this command before changing the codepage:


and then use the following command to restore the original codepage afterwards:


InserachofAuthor Commented:
Add the chcp 1252

Still No Good

I am attaching the reportA.txt file reportA.txt
sjklein42Connect With a Mentor Commented:
reportA.txt is definitely UNICODE.  We know that copy /A doesn't work.

But the "type" approach should have worked.

Please post report.txt (as opposed to reportA.txt) since that's the one we expected to work but didn't.

Thanks.  I'll check back in a few hours.

InserachofAuthor Commented:
Just tried the type method and still nothing

attached is the batch file and result file report.txt

sjklein42Connect With a Mentor Commented:
Thanks for all the files.  A real puzzler.

As far as I can tell, report.txt is a clean, ASCII file - no UNICODE - just what we want it to be.  I can't see any reason why it is not coming up as text when opened as an attachment.

Another experiment you could try would be to send report.txt as an attachment using another email client - any other client - gmail, even.  See if it arrives as text or not.  This will tell us if the problem is just febootimail or is deeper.  Either way it will be interesting.
InserachofAuthor Commented:
I know been fighting with this one for a long while

I sent both txt report.txt and reporta.txt to three (3) different emails

1. blackberry email  both opened
2. yahoo email both opened
3. my exchange email on outlook both opened
4. my exchange email (desktop) on my cell both failed unable to retrieve

when you reopen the email on the desktop icon on my cell it shows the status of

Mailbox couldn't find original message,if forwarding or replying please resend the message

the saga continues

sjklein42Connect With a Mentor Commented:
I'm starting to clutch at straws, but those symptoms implicate your (Blackberry?) setup.  Perhaps...


Cause 4

You are using Group Shield for Microsoft Exchange and running Exchange Information Store 5.5 SP3.


Remove and re-add the BlackBerry smartphone user to the BlackBerry Enterprise Server. If the issue is not resolved, repair the BlackBerry smartphone user’s mailbox. For instructions on repairing a BlackBerry smartphone user’s mailbox, see the documentation for Microsoft Exchange.

InserachofAuthor Commented:
No No No

I am running Exchange 2007 entrprise server 64 bit SP3  not 5.5
sjklein42Connect With a Mentor Commented:
OK.  I've run out of ideas.  Sorry.  No soup for me.
InserachofAuthor Commented:
FEBOOTI has a probloem sending attached files to a blackberry thier support does not have any blackberry service to test with had to use
-MSG -USEFILE mailboxesA.txt

This places the contents of mailboxesA.txt into the body of the email and thats is working

Would like to have the attachment work  but this will do for now...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.