I am trying to first get the message number of the email with the subject of SECURITYsense.  Then getall on that message number to get the attachments.  Then find the attachment with HTML in the name.  After that create a .bat file to unzip that attachment to a new folder.

I don't get any errors when I run the code, the attachments are placed in the folder where I expect them to be.  The bat file is created with the correct syntax for winzip to unzip the file and create the folder.

I can remote connect to the server and run the bat file and get the desired results.  The folder is created and the file is unzipped into it.

But when I try it through this code the folder is not created and the files are not unzipped.

Any idea?

David

<cfpop action="" name="GetHeaders" server="mail3" username="foobar" password="foobar">
<!--- winzip32 -e [options] filename[.zip] folder --->

<cfoutput query="GetHeaders">
<cfif Find("SECURITYsense",subject)>

<cfpop action="" name="GetAttachments" messagenumber="#GetHeaders.MessageNumber#" attachmentpath="i:\inetpub\wwwroot\phanet\security\auto" server="mail3" username="foobar" password="foobar">

<cfset ElementIndex = ListContainsNoCase(GetAttachments.attachments,"html",chr(9))>
<cfset Request.FileName = ListGetAt(GetAttachments.attachmentFiles,ElementIndex,chr(9))>
<cfset Request.Path = "i:\inetpub\wwwroot\phanet\security\" & ListGetAt(ListGetAt(GetAttachments.attachments,1,chr(9)),1,".") & "_" & DateFormat(now(),"yy")>

<cfset Request.batch_file_output="c:\winzip\winzip32.exe -e -o -j #Trim(Request.FileName)# #Trim(request.path)##chr(13)##chr(10)#">

</cfif>

</cfoutput>

<cffile action="" file="i:\inetpub\wwwroot\phanet\security\auto\unzipanddelete.bat" output="#Request.batch_file_output#" addnewline="no">

<cfexecute name="unzipanddelete.bat"></cfexecute>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to