Jump to content
Sign in to follow this  

help? getting path for required txt, doc, xls files for different users

Recommended Posts


This may have been addressed before but I've spent a couple hours searching and can't find it.

I have a script I have been using for a couple years that I have to hand off to other people. There are a handful of various txt, doc and xls templates that are accessed and modified then saved with date names, each file used in some other step in the process. I currently open an app like Word and then have the path included in a "send" command to complete the file-open sequence. I do this for each file.

I could simply tell everyone create the appropriate path and put the templates in the same folders as mine, but would prefer to allow them to put the files wherever they want. To do this I would have to have the script start by asking them where the files are located, easy enough to do, but I don't know how to store that information in a way that will allow the script to not have to ask the next time they run it. this is a program that is run weekly.

I currently declare variables for each of the 7 files and use the variable name in the send command mentioned above.

dim $IJA_doc

dim $IJA_txt

dim $IJA_tabtxt

dim $IJA_xlt

dim $IJA_xls


I am hoping there is a way I can update these variables, even in an external file if needed, so that once done it doesn't have to ask again.

If it matters:

my script checks for the existence of the apps that are needed such as Aquadata (a query tool), word, excel and our in-house built green-screen app.

It then launches the query tool, loads and runs a query. It puts the results into a text file then opens excel and loads a template then imports the text file and saves the result as a xls with the date added to the name. Then it launches word, loads a template, runs a mail merge importing from the dated xls and outputs letters with the date added to the file name. Next it saves the xls as a tabbed txt and logs into our green-screen app and starts a macro that pulls its data from the tabbed-txt file and thats it.

the green screen and macro portion is all enclosed within a function and aside from some Microsoft oddities where the import to excel sometimes doesn't preserve the column spacing (I got tired of trying to fix it so just built in a pause to allow me to manually double check and move the lines) everything works great.



Share this post

Link to post
Share on other sites

I'd say RegRead() and RegWrite(). Read the key, if it's blank ask them then write it. If it isn't blank use that path. Try a FileExists() on the path to make sure it's there, if not ask them then write.

Share this post

Link to post
Share on other sites

Yeah either that or INIWrite/INIRead.

Same difference really just depends on what would work better for you in this case.


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post

Link to post
Share on other sites

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
Sign in to follow this