Uraken Posted January 26, 2007 Posted January 26, 2007 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.
ITWombat Posted January 26, 2007 Posted January 26, 2007 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/
ITWombat Posted January 27, 2007 Posted January 27, 2007 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
Uraken Posted January 28, 2007 Author Posted January 28, 2007 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.
srochford Posted January 28, 2007 Posted January 28, 2007 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"
plexer Posted January 29, 2007 Posted January 29, 2007 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
Uraken Posted January 29, 2007 Author Posted January 29, 2007 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?
Uraken Posted January 29, 2007 Author Posted January 29, 2007 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).
AlexB Posted January 29, 2007 Posted January 29, 2007 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
Uraken Posted January 30, 2007 Author Posted January 30, 2007 will this work with redirected desktops mate?
Uraken Posted January 31, 2007 Author Posted January 31, 2007 do i need a linkd exe for this to work ?
AlexB Posted February 1, 2007 Posted February 1, 2007 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now