Probably simple...

Associate
Joined
20 Oct 2005
Posts
1,900
Location
Suffolk, UK
Just trying to streamline my workflow, I need 2 things to happen on log on daily:

1) Print a copy of the Trunking VLU Weights sheet - literally just the right click -> print from the context menu in the explorer window. If this can happen on log on somehow that would be ideal.

2) Save a copy of the Daily Trunk Summary in another folder suffixed with the day.month. Currently I open this spreadsheet, save as, go into the archive folder, put yesterday's day.month (12.6) after the filename and save, then open the "live" version again.

Is it possible to script these two processes and have both occur on log on? Thanks
 
To answer no.1;

create a batch file with the following in, and add it to your Logon policy in group policy. Assuming you can get to GP on your workstation? If not, do you have a domain admin account you can use?

Code:
PRINT "path to file" /D:printerport
get the printer port from the printers properties :)

edit, for 2 check this out: http://www.msfn.org/board/topic/116900-batch-file-copy-and-rename-with-date/
 
Last edited:
I forgot to mention, the trunking weights sheet is .xls, does this make a difference to the PRINT command? Also the printer is a network printer, so the port is IP_10.137.4.31 not a standard LPT1. Thanks for your help so far, that network file copy page looks very helpful too
 
The file format should not make any difference to the print command.

Obviously being an Excel file, the format may need some adjusting if it's not to your taste.

yes, use the IP_xxx as the printer port.
 
I've found a handy tool called classExec, which allows a batch to use DDE commands - so anything with a "print" command on a context menu.

Edit: Sorted 1), now onto the more complicated saving a copy of the daily trunk summary!
 
Last edited:
No.2;

It's easy to get todays date by using %DATA% so to copy and rename a file with todays data at the end you would use:
Code:
xcopy c:\summary.xls "c:\new folder\summary%date%.xls"

Getting yesterdays date will require an external script to calculate it and then passing that variable through... plenty of scripts out on the net to do this;

http://www.powercram.com/2010/07/get-yesterdays-date-in-ms-dos-batch.html
http://www.robvanderwoude.com/datetiment.php#Yesterday

See if they are any good for you :)
 
The problem with this is the complicated nature of where it's saved; monthly folders, although this is easily fixed by editing the batch on the last day of every month to use the following month's folder - or make a second batch to edit the first and run that on the first of every month! :D

Also I only run this week days, so when I come in Monday, I'll want it to save it with friday's date. I don't mind editing the batch file at the end of every month, just need the weekly cycle to be automated.
 
Last edited:
Back
Top Bottom