I am attempting to open and print a file that is housed on our network. I can open the folder and get to a specific file. My problem is the file I want to grab in the macro will vary depending upon the day. For instance, this is what I currently have in the script:
run program>explorer H:\Lockbox\Reports\Lockbox Transmission Report 10-19-2004 06-40am.htm
Wait>1.05
Press enter
Wait>1.05
Very, very straightforward, but if the part of the file "10-19-2004" will change every day and the time after it will vary, what are suggestions on how to cull out just today's date? Do I need to run a getdate somewhere to pull todays date and then pass that variable into what explorer is looking for?
How to grab a specific file within a folder
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Use this to get current date information:
Month>MM
Day>DD
Year>YYYY
Then use those variables in your file name:
run program>explorer H:\Lockbox\Reports\Lockbox Transmission Report %MM%-%DD%-%YYYY% 06-40am.htm
-----------------------------
You will get either 2 or 4 digits for the year, depends on your System settings for Date.
-----------------------------
You might also try getting a GetFileList>H:\Lockbox\Reports\Lockbox Transmission Report %MM%-%DD%-%YYYY% *.htm, Separate the file out, and save the result as a variable for your filename that will provide the real name with the time shown.
Month>MM
Day>DD
Year>YYYY
Then use those variables in your file name:
run program>explorer H:\Lockbox\Reports\Lockbox Transmission Report %MM%-%DD%-%YYYY% 06-40am.htm
-----------------------------
You will get either 2 or 4 digits for the year, depends on your System settings for Date.
-----------------------------
You might also try getting a GetFileList>H:\Lockbox\Reports\Lockbox Transmission Report %MM%-%DD%-%YYYY% *.htm, Separate the file out, and save the result as a variable for your filename that will provide the real name with the time shown.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!