batch files at logoff

Creating a .bat file to 'save as html', open with Excl, save f

Page 1 of 1

2 Replies - 3065 Views - Last Post: 28 May 2007 - 10:22 AM Rate Topic: -----

#1 tonymorton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-May 07

batch files at logoff

Posted 27 May 2007 - 04:10 AM

I am a complete beginner to batch files altough I have a little knowledge of Visual Basic. Having successfully used AutoIT, which is a GUI based program to achieve what I have set out below, I have found it will not work 24/7 because of Novell autlogoff - I cannot get this disabled for security reasons.

I want to be able to write a .bat file to work when the computer is logged off via Novell security to:

open a real time database program called 'Pulse'
save this as an html file
open this file with Excel
save the Excel file every hour between 0900 until 22:00 Monday through Sunday.

Assuming the program was in C:\programs as 'Pulse.exe and the destination path was Y:\reports\Mon etc

How would I save the file there as '0900Mon'?

Many thanks.

Is This A Good Question/Topic? 0
  • +

Replies To: batch files at logoff

#2 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: batch files at logoff

Posted 27 May 2007 - 02:07 PM

It sounds as though you will want to use a scripting language like VBS or JS rather than a Batch program. The reasons I say this are:
* unless Pulse.exe has a command line option for "Save as HTML" you will need to use "Sendkeys" or Automation to have the program save as HTML.
* IT is not easy to get a batch file to run "every hour..." (though I suppose you could use a task scheduler.

There is something curious... "when the computer is logged off..." "...save the Excel file every hour..." This is a little curious. You want the process to start at a logoff, and then continue to run until someone logs back on?

Another thing: Why would you save the Excel file every hour -- it would not change. Do you mean that it should load the database, save as HTML, import that into excel and save as an excel file once every hour?

Anyway, To use a Script that uses SendKeys you need to write out all of the keystrokes needed from the moment that Pulse.exe is loaded to open the database and save the database as an html file.
Was This Post Helpful? 0
  • +
  • -

#3 tonymorton  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-May 07

Re: batch files at logoff

Posted 28 May 2007 - 10:22 AM

View Posttonymorton, on 28 May, 2007 - 10:13 AM, said:

View PostNickDMax, on 27 May, 2007 - 02:07 PM, said:

It sounds as though you will want to use a scripting language like VBS or JS rather than a Batch program. The reasons I say this are:
* unless Pulse.exe has a command line option for "Save as HTML" you will need to use "Sendkeys" or Automation to have the program save as HTML.
* IT is not easy to get a batch file to run "every hour..." (though I suppose you could use a task scheduler.

There is something curious... "when the computer is logged off..." "...save the Excel file every hour..." This is a little curious. You want the process to start at a logoff, and then continue to run until someone logs back on?

Another thing: Why would you save the Excel file every hour -- it would not change. Do you mean that it should load the database, save as HTML, import that into excel and save as an excel file once every hour?

Anyway, To use a Script that uses SendKeys you need to write out all of the keystrokes needed from the moment that Pulse.exe is loaded to open the database and save the database as an html file.


I think (I will need to check when bck at work) that Pulse does have an option to save as HTML.

No, I could (and have) start it running when the computer is logged on, problem is after 5 min or so of inactivity it logs itsef off for security reasons. Therefore I could not get it to run in the evenings, say between 19:00 and 22:00 when I'm not at work. Also, saving every hour is needed because the data in Pulse (a real-time database) changes and therefore each hourly Excel report will contain different data.

I do use sendkeys in some programs that I write but:

cannot use sendkeys for right clicks (eg. 'open with' Excel for the (saved) html file)

Also, I thought a batch file could run when the computer was logged off, the visualbasic script would run through Excel and I would not have access to program resources when the computer was logged off.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1