[gptalk] Shortcuts with Environment Variables

  • From: <dcnash@xxxxxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Wed, 3 Jan 2007 11:10:51 -0500

Here is my situation, we have close to 150 computers, some with different 
versions of office on them. We have some systems with Office XP installed and 
some with Office 2003. They all run Windows XP. As you know office's 
installation path for Office XP is c:\program files\microsoft office\office10. 
The only difference between the installation path for XP and 2003 is 
c:\*\office11 instead of c:\*\office10.
I'm trying to create a shortcut that points to excel.exe within the default 
installation path for office. There is only one version of office installed on 
each system therefore only ONE of these folders will exist.
So far Ive created an environment variable that points to c:\program 
files\microsoft office\office*\. Ive named the environment variable Office. 
When I open command prompt and type "cd %office%" it works beautifully. When I 
create the shortcut it tries to resolve the folder path litterally as 
"c:\%office%\excel.exe" instead of substituting the environment variable value 
of "c:\program files\microsoft office\office*\"

I can create a batch file that runs it, copy that via login script to local 
boxes, then create and run a shortcut that points to the batch file and hides 
the command prompt window, but that would be a major pain in the behind. Any 
ideas here? Im wondering if there is a vbscript or something that will actually 
run the program for me from the correct folder path. I dont know vbscript 
otherwise I would try and write this myself. Any help is greatly appreciated!

Thanks guys!

DC Nash

You can unsubscribe from gptalk by sending email to 
gptalk-request@xxxxxxxxxxxxx with 'unsubscribe' in the Subject field OR by 
logging into the freelists.org Web interface. Archives for the list are 
available at http://www.freelists.org/archives/gptalk/

Other related posts: