Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hi

 

I would like a script that will print a html file.

 

Would also like to email it if possible and have it triggered from a .exe

 

I'm sure its possible but have not found a solution that works for me yet.

 

Thanks

  • 3 months later...
Posted
When you say print, do you mean send it to a printer? or save it as a html file and then e-mail that html file as an attachment in an e-mail?
Posted

You can use a powershell script to save a html page. Command as follows;

 

wget http://blog.stackexchange.com/ -OutFile C:\out.html

 

open up notepad copy and paste that into it and replace the stack exchange url with the one you want to save, and the output location and file name, file>save as, and save it as htmlsave.ps1, then you can create a vbscript to send an e-mail and have the html file as an attachment. VBScript To Send Email Using CDO heres a tutorial on how to do that. Then you can create a batch file to run both the ps1 and then the vbs file, something like;

@echo off

start C:\Filepath\HTMLSAVE.PS1

start C:\Filepath\e-mail.vbs

del C:\filepath\HTMLPAGE.html

exit

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...