Solved

What type of file is created when done thru CMD file

Posted on 2011-02-12
15
418 Views
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 192.168.1.26

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


exit


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

Tom
0
Comment
Question by:Inserachof
  • 8
  • 7
15 Comments
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
Try updating to Febooti Version 4.0 (released Jan 24,2011).  The content MIME type of email attachments is now specified more precisely.
0
 

Author Comment

by:Inserachof
Comment Utility
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
0
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
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?
0
 

Author Comment

by:Inserachof
Comment Utility
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
0
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
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:

FOR /F %%A IN ('CHCP') DO SET CHCP=%%A

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

CHCP %CHCP%

0
 

Author Comment

by:Inserachof
Comment Utility
Add the chcp 1252

Still No Good

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

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
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.

0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:Inserachof
Comment Utility
Just tried the type method and still nothing

attached is the batch file and result file report.txt

report.txt
emailstats.cmd
0
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
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.
0
 

Author Comment

by:Inserachof
Comment Utility
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

0
 
LVL 16

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
I'm starting to clutch at straws, but those symptoms implicate your (Blackberry?) setup.  Perhaps...

http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB00353#cause4

Cause 4

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

Resolution

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.


--------------------------------------------------------------------------------
0
 

Author Comment

by:Inserachof
Comment Utility
No No No

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

Assisted Solution

by:sjklein42
sjklein42 earned 500 total points
Comment Utility
OK.  I've run out of ideas.  Sorry.  No soup for me.
0
 

Accepted Solution

by:
Inserachof earned 0 total points
Comment Utility
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
0
 

Author Closing Comment

by:Inserachof
Comment Utility
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...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

12 Experts available now in Live!

Get 1:1 Help Now