PC Review


Reply
Thread Tools Rate Thread

batch files at logoff

 
 
=?Utf-8?B?WmFreW50aG9z?=
Guest
Posts: n/a
 
      28th May 2007
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 autologoff - 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

What would be the batch file code to save the file there as '0900Mon' etc etc?

Many thanks

 
Reply With Quote
 
 
 
 
Pegasus
Guest
Posts: n/a
 
      28th May 2007

"Zakynthos" <(E-Mail Removed)> wrote in message
news:8D20C49D-7E10-4BCF-8143-(E-Mail Removed)...
>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 autologoff - 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
>
> What would be the batch file code to save the file there as '0900Mon' etc
> etc?
>
> Many thanks
>


If you wish to save the Excel file as 0900Mon.xls then you need
to post your question in an Excel newsgroup and ask for a
suitable macro to do it.


 
Reply With Quote
 
Newbie Coder
Guest
Posts: n/a
 
      28th May 2007
Zakynthos,

If you run this during logoff/shutdown etc you will halt the process

Windows uses the WM_QUERYENDSESSION message & that is where you have to run
what you need to do.

The only way I can see you getting around the problem is to see if the
administrators will allow you to run a unique VBS, but don't forget that
opening a DB that has received the above Windows Message will be impossible
because the DLLs won't initilise...

Another way around it is to trap the above Windows Message, remove the
SE_SHUTDOWN_PRIVILEGE do your work & then re-enable the privilege to enable
logoff/shutdown. That is extremely simple itself, but whether you'll have
the security permissions is another thing. In code access security you could
punch it through though, but as you have said you are a beginner when it
comes to VB so, you will find it difficult

What the other user said abour renaming an Excel spreadsheet... isn't going
to work running a built in VBA macro unless you create a new file because
with the document open you will have locked the write access & you'll get
its in use by another process error

The easiest way for you around it is for the admins to write you a script to
run at logoff

Hope this helps,

--
Newbie Coder
(It's just a name)




"Zakynthos" <(E-Mail Removed)> wrote in message
news:8D20C49D-7E10-4BCF-8143-(E-Mail Removed)...
> 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 autologoff - 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
>
> What would be the batch file code to save the file there as '0900Mon' etc

etc?
>
> Many thanks
>



 
Reply With Quote
 
=?Utf-8?B?WmFreW50aG9z?=
Guest
Posts: n/a
 
      28th May 2007
Thanks for your comments.

I can see it's going to be difficult and I don't think I'll get much
cooperation from the computer admin team.

Having successfully run AutoIT to perform these actions during work hours, I
know that a GUI environment works perfectly but cannot get the Novell logoff
disabled.

I am wondering whether I might use task scheduler to run reglar routines
such as opeing and then shutting a program every 5 minutes or so just to keep
the computer busy to stop it logging off?

However, if the key times for running the routines to save my files are on
the hour until about 5 past the hour it's going to mean setting up alot of
task schedules between hr+ 5 min and hour -5 min 0900 until 22:00 Mon-Sun -
just to keep from logging off. Do you think this might work?

I just assumed that as batch files could run when a computer is logged off,
this would be the best way of solving the problem.

Many thanks

"Newbie Coder" wrote:

> Zakynthos,
>
> If you run this during logoff/shutdown etc you will halt the process
>
> Windows uses the WM_QUERYENDSESSION message & that is where you have to run
> what you need to do.
>
> The only way I can see you getting around the problem is to see if the
> administrators will allow you to run a unique VBS, but don't forget that
> opening a DB that has received the above Windows Message will be impossible
> because the DLLs won't initilise...
>
> Another way around it is to trap the above Windows Message, remove the
> SE_SHUTDOWN_PRIVILEGE do your work & then re-enable the privilege to enable
> logoff/shutdown. That is extremely simple itself, but whether you'll have
> the security permissions is another thing. In code access security you could
> punch it through though, but as you have said you are a beginner when it
> comes to VB so, you will find it difficult
>
> What the other user said abour renaming an Excel spreadsheet... isn't going
> to work running a built in VBA macro unless you create a new file because
> with the document open you will have locked the write access & you'll get
> its in use by another process error
>
> The easiest way for you around it is for the admins to write you a script to
> run at logoff
>
> Hope this helps,
>
> --
> Newbie Coder
> (It's just a name)
>
>
>
>
> "Zakynthos" <(E-Mail Removed)> wrote in message
> news:8D20C49D-7E10-4BCF-8143-(E-Mail Removed)...
> > 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 autologoff - 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
> >
> > What would be the batch file code to save the file there as '0900Mon' etc

> etc?
> >
> > Many thanks
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I run a batch file at logoff or shutdown? Zilla Windows Vista General Discussion 5 25th Jun 2010 05:11 PM
*** How to LogOff using batch file *** N@xo Microsoft Windows 2000 2 10th Aug 2004 08:25 PM
running a program (or batch file) at logoff? Christopher Scott Windows XP Setup 2 31st Mar 2004 08:13 PM
running a program (or batch file) at logoff? Christopher Scott Windows XP Help 2 31st Mar 2004 08:13 PM
running a program (or batch file) at logoff? Christopher Scott Windows XP General 2 31st Mar 2004 08:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 PM.