Jump to content

Recommended Posts

Posted

Hi all we currently operate in mixed office mode so i want to try and create a script that will work out what version of office is installed on the pc and copy the correct office shortcuts to the desktop from a server share. At present i use redirected start menus, and desktops and just copy two sets of shortcuts (office 2000 & office 2003) and the users have to work out which is installed so far i have put a file on all the office 2000 machines called office2000 and created the following:

 

if exist "c:\office2000 goto office2000"

copy "\\servername\share\desktop2003\*.*" "%userprofile%\desktop\"

 

:office2000

copy "\\servername\share\desktop2000\*.*" "%userprofile%\desktop\"

:end

 

But it copys them all over ? its late on a friday night and i'm missing something simple but what anyone?

cheers as always in advance.

Posted

I can see two problems

 

This if test will fail because you have put quotes round the goto.There should only be round the file name, really only file name contains white space..

 

if exist "c:\office2000 goto office2000"

 

So now the script copies the Office 2003 shortcut

 

copy "\\servername\share\desktop2003\*.*" "%userprofile%\desktop\"

 

But you forgot to put a goto to jump to the end of the script so now the script copies the Office 2000 shortcut

 

:office2000

copy "\\servername\share\desktop2000\*.*" "%userprofile%\desktop\"

:end

 

Yes it's Friday night and I'm sober \\:D/

Posted

For completeness, I would also have to say that besides scripting you have two other options:

 

MSI Tranforms

If you have deployed office using a GPO then you can create an MST with Custom Maintanenance Wizard to place the office app shortcuts on the desktop.

 

Manually copy shortcuts to C:\Documents and Settings\All Users\Desktop

As you gone to the trouble of placing the C:\Office2000 files on the Office machines why not just copy the relevant shortcuts to All Users on each machine. This would much simpler even if you were using roaming profiles.

 

Just of interest, is there a particular reason why the script does things on a per user basis? Now, although the file copy won't take much time out of each log-on, It's still being performed each time a user logs in.

 

You may also want to test for the Office applciation folder (e.g. C:\Program Files\Microsoft Office\Office11 for Office 2003) rather than putting the C:\Office file on the on each computer.

 

 

OK. I've gone on long enough so I'll shut up now.

 

----------------------------------------------------------------------

Have a desire to make the world a better place one punctuation mark at a time?

 

Visit our site at http://www.nitpickers-anonymous.org

Posted

Hi ITwombat thanks for the input mate

a.we deployed manually, so msi transforms a non-starter

b. hadn't thought about doing it on machine start up? i use redirected desktops would this still work? (i need to try i suppose)

c. Already thought of this one (checked the difference between installs, which is office and office11 this works well).

thanks again.

Posted

Another way would be to use the same shortcut for all desktops but make it point to a script which determines which version of office is installed - something like this should work.

 

set ofso=createobject("scripting.filesystemobject")

set oShell=createobject("wscript.shell")

 

if ofso.fileexists("c:\program files\microsoft office\office10\winword.exe") then oShell.run "c:\program files\microsoft office\office10\winword.exe"

 

if ofso.fileexists("c:\program files\microsoft office\office11\winword.exe") then oShell.run "c:\program files\microsoft office\office11\winword.exe"

Posted

I use a vbs on startup to set an environment variable called office that points to the location of the office installation and then the shortcut on their desktop for word would be %office%\winword.exe

 

We used to have 3 different versions of office, 2000, xp and 2003 and this worked fine now we only have 2003 so it's not required.

 

Ben

Posted
hi chaps i managed to get the batch file to work, but have a slight problem in so much as it rembers that the shortcuts are there for each log on? can i get to only put the shortcuts there whilst logged on and then have them deleted on log off?
Posted
have tried del /q "%userprofile%\desktop\*.*" before the copy commands which works ok but its a bit messy (the users can see the old shortcuts getting replaced).
Posted

At my previous job I created a virtual link on each computer (scripted in the logon) which went something link this (not real code ;) )

 

sod it, I found the batch file I kept

 

if exist "c:\program files\Microsoft office\soffice" goto end


REM ***** Do checks for standard office files *****
REM ***** Check for Office 10 *****
if exist "c:\program files\Microsoft office\Office10\winword.exe" linkd "c:\program files\Microsoft office\soffice" "C:\Program Files\Microsoft Office\Office10"

REM ***** Check for Office *****
if exist "c:\program files\Microsoft office\Office\winword.exe" linkd "c:\program files\Microsoft office\soffice" "C:\Program Files\Microsoft Office\Office"


REM ***** Do checks for frontpage files *****
REM ***** Check for Office 10 *****
if exist "c:\program files\Microsoft office\Office10\frontpg.exe" linkd "c:\program files\Microsoft office\foffice" "C:\Program Files\Microsoft Office\Office10"

REM ***** Check for Office *****
if exist "c:\program files\Microsoft office\Office\fronpg.exe" linkd "c:\program files\Microsoft office\foffice" "C:\Program Files\Microsoft Office\Office"


REM ***** Do checks for publisher files *****
REM ***** Check for Office 10 *****
if exist "c:\program files\Microsoft office\Office10\mspub.exe" linkd "c:\program files\Microsoft office\poffice" "C:\Program Files\Microsoft Office\Office10"

REM ***** Check for Office *****
if exist "c:\program files\Microsoft office\Office\mspub.exe" linkd "c:\program files\Microsoft office\poffice" "C:\Program Files\Microsoft Office\Office"


:end

 

Now this might look complicated, but all it does is create a virtual folder c:\program files\Microsoft office\soffice where the necessary executables can be found regardless of the install. Therefore the shortcuts for any version just used the virtual folder.

 

(The publisher and frontpage virtual folders were because they seemed to like to have different homes!)

 

Note, the linkd virtual link is permenantly created as part of the ntfs volume and therefore only needs creating once per machine.

 

Hope this helps

Posted

linkd.exe is part of one of the microsoft admin packs

 

It works with redirected desktop as the shortcut is the same no matter the machine, therefore, no complicated working out which office version is installed on a machine each time.

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



×
×
  • Create New...