Announcement

Collapse
No announcement yet.

a logon script how to question

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

  • a logon script how to question

    hello everyone,
    my company has a server 2003 system and we have a special application that we want it to be applied when a user login,
    but, we need it to run only once! if it already applied then it should not run again

    thanks in advance and sorry for my poor grammar :]

    Daniel.

  • #2
    Re: a logon script how to question

    Originally posted by daniel669 View Post
    my company has a server 2003 system....
    But the DC's are Windows 2008? since you post your question in the Windows server 2008 forum.
    Maybe a better forum would be the GPO or scripting forum to post this question.

    solutions.
    Create a msi package - And deploy the software with a GPO via a software installation policy.
    Or,
    when you install it with a script - The script should check first whether the software is already installed or not on the computer. (can do that via a file sytem or via a registry check. If the software installation does not leave that kind of information, use the script to create some kind of 'mark' in a folder or registry on the computer before the installing processes is launched).


    \Rems
    Last edited by Rems; 24th September 2008, 13:44. Reason: moved from Windows Server 2008-forum

    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: a logon script how to question

      thanks for ur quick answer,
      can u point me to an installation script that does that?

      Comment


      • #4
        Re: a logon script how to question

        Originally posted by daniel669 View Post
        thanks for ur quick answer,
        can u point me to an installation script that does that?
        vbs or batch?
        can you tell a little bit more about the software. Is it visible in the c:\program files folder? or can you find something about the installation in the registry? That can be used as the 'mark' to seach for the script.


        \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


        • #5
          Re: a logon script how to question

          a Batch script would be useful!
          the program wich is a MSI installer extracting new db definition files into c:\program files\eldb
          it's only copy some new files into it, no registry..

          thanks!

          Comment


          • #6
            Re: a logon script how to question

            Windows Installer writes uninstall-information for the installed software in the registry. With the information from the registry the script can determine if the sofware is installed already or not.

            Lets find out whether this is also the case with your software.
            Search that registrykey and subkeys on a computer were the software already is installed to list the Displaynames of all the installed software done by WindowsInstaller. Use the list to determine the "Displayname" of your software.
            Code:
            @echo off
            
            Set "strKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
            >"%temp%.\installedSW.txt" (
             start "export" /w /b Reg query "%strKey%" /s | find/i "DisplayName"
            )
            notepad "%temp%.\installedSW.txt"

            Then, when you know the displayname, this is the batch you can use to determine whether the software should be installed or not,
            Code:
            @echo off
            :: cut --- 8<------------
            
            Set "DisplayName=MSXML 6.0 Parser" replace with the 'exact' displayname of the software you are installing
            
            Set "strKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
            Reg query "%strKey%" /s | (find/i "DisplayName" | find/i "%DisplayName%")>nul &&(
              echo.%DisplayName% is alread installed, script will continue w/out installation
            )||(
              echo.Installing %DisplayName%,
            
              echo.place the commands to install the software here.....
            
            )
            
            :: cut --- 8<------------
            pause
            \Rems
            Last edited by Rems; 25th September 2008, 11:28. Reason: fixed wrong interpretation in 2nd batch

            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


            • #7
              Re: a logon script how to question

              Will try this one! thanks

              Comment

              Working...
              X