Announcement

Collapse
No announcement yet.

How to use office 2003 custom maintenance wizard by script?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use office 2003 custom maintenance wizard by script?

    Hi

    i want to use gpo startup script to deploy office configuration.
    my script checks for a file present, and if the file is not present then is will execute the wizard.
    but it's not working.
    something is wrong with the command, since no log file is created.

    if I'm putting an echo command, it is executed perfectly.

    the command is like that :

    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "C:\Progra~1\ORKTOOLS\ORK11\TOOLS\Custom~2\MAINTWI Z.EXE /c c:\office2003.cmw"

    right now the .cmw is located on c: drive, but latter i want this file to be located on the network


    i appreciate any help

    Yaniv

  • #2
    Re: How to use office 2003 custom maintenance wizard by script?

    Try, starting the command interpreter (open command window) first for running the command line .
    http://www.microsoft.com/technet/scr....mspx?mfr=true


    Code:
    Const PROGRAM_FILES = &H26&
    
    With CreateObject("Shell.Application")
      programsfolder = .Namespace(PROGRAM_FILES).Self.Path
    End With
    
    strApp = programsfolder & "\ORKTools\ToolBox\Tools\" _
      & "CIW and IEAK\Custom Installation Wizard\MAINTWIZ.EXE"
    strCfgFile = "c:\office2003.cmw"
    
    Set objShell = CreateObject("WScript.Shell")
    objShell.Run "%comspec% /c """ & strApp & """ /c """ & strCfgFile & """"
    Oh, and try to avoid short path names in startup/logon scripts, it is unrelaiable to use for multiple computers.

    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: How to use office 2003 custom maintenance wizard by script?

      thanks
      I'll check it

      the reason i was using short file names, is because the script says he can't find the file.

      Comment


      • #4
        Re: How to use office 2003 custom maintenance wizard by script?

        Originally posted by Yaniv Hoobian View Post
        the reason i was using short file names, is because the script says he can't find the file.
        If the path contains spaces then it should be added between quote signs. If the quotes are with-in quotes (the command string for objShell.Run is already between quotes), in vbs use double set of quote-signs like I did in the previous sample or, you can use the ascii code resulting a quote sign.

        example using the ascii code:
        Code:
        q = chr(34) 'acsii value for a quote-sign
        strTitle = "Office 2003 Custom Maintenance Wizard"
        objShell.run "%comspec% /c title " & strTitle & "|" & q & strApp & q & " /c " & q & strCfgFile & q ,,true
        note;
        I added an optional title ( title " & strTitle & "|" ) for the command window. If startup scripts are running visible you now can read what is running.

        I also added ,,true at the end - to be sure the startup script itself does not end before the wizard has finished.
        There are in fact 2 optional parameters for the Run method , intWindowStyle, bWaitOnReturn : http://msdn.microsoft.com/en-us/libr...ky(VS.85).aspx

        From what I know, it is also possible to run MAINTWIZ.EXE from a unc path.
        ( "unc\maintwiz.exe" /c "unc\office2003.cmw" )


        \Rems
        Last edited by Rems; 17th September 2008, 11:53.

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment

        Working...
        X