Go Premium for a chance to win a PS4. Enter to Win


What type of file is created when done thru CMD file

Posted on 2011-02-12
Medium Priority
Last Modified: 2012-06-22
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

Question by:Inserachof
  • 8
  • 7
LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34880610
Try updating to Febooti Version 4.0 (released Jan 24,2011).  The content MIME type of email attachments is now specified more precisely.

Author Comment

ID: 34893524
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
LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34893664
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?
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 34893750
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
LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34893801
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:



Author Comment

ID: 34901447
Add the chcp 1252

Still No Good

I am attaching the reportA.txt file reportA.txt
LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34901592
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.


Author Comment

ID: 34902249
Just tried the type method and still nothing

attached is the batch file and result file report.txt

LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34902846
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.

Author Comment

ID: 34905373
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

LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34907902
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.


Author Comment

ID: 34912231
No No No

I am running Exchange 2007 entrprise server 64 bit SP3  not 5.5
LVL 16

Assisted Solution

sjklein42 earned 2000 total points
ID: 34912261
OK.  I've run out of ideas.  Sorry.  No soup for me.

Accepted Solution

Inserachof earned 0 total points
ID: 34913092
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

Author Closing Comment

ID: 34968257
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...

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

916 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