Announcement

Collapse
No announcement yet.

Deploy hta

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

  • Deploy hta

    Hello,
    I need to deploy an hta file on user's desktop.
    We have a Windows 2003 Server R2 Active Directory domain and Windows 2000/XP client.
    Thanks in advance.

  • #2
    Re: Deploy hta

    you can use a batch or vbs script configured in a GPO to run as user logon script.

    The script determine the path to the desktop folder of the user (the script get the actual path from the system), then copy the HTA-file from a network share to the desktop folder of the user.

    Do you prefere a batch or vbscript?

    It is also possible to make the script copy the HTA-file to a new sub folder in the "program files folder" and create a shortcut on the user's (or 'All Users'-) desktop folder to the HTA-file.


    \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: Deploy hta

      I made a .bat file that copy the .hta file on the all users desktop (user logon script)
      Many thanks

      Comment


      • #4
        Re: Deploy hta

        Originally posted by Max Dembo View Post
        I made a .bat file that copy the .hta file on the all users desktop (user logon script)
        Many thanks
        Glad to be of some assistance.

        Note that regular Users by default don't have permissions to write to the "All Users" desktop.
        Therefore,
        ** For copying the file to the Current User's desktop use a User Logon Script.
        ** For copying the file to the ALL USERS desktop use a Computer Startup Script.

        sample of a LogonScript:
        Code:
        :: ** User Logon Script **
        :: Copy a file to Current User's desktop
        
        @echo Off &cls &setlocal
        
        Set "SpecialFldr=Desktop"
        set "key=HKCU"
        
        Set "key=%key%\SOFTWARE\Microsoft\Windows\CurrentVersion"
        Set "key=%key%\Explorer\Shell Folders"
        :: note, Delims=<tab>
        For /f "tokens=2,* Delims=	" %%A in (
           'reg.exe query "%key%" /v "%SpecialFldr%"^|find/i "%SpecialFldr%"'
           ) do call set "SpecialFldr=%%~B"
        
        echo Destination Folder is "%SpecialFldr%"
        xcopy /y "\\server\share\folder\File.hta" "%SpecialFldr%\"
        sample of a StartupScript:
        Code:
        :: ** Computer Startup Script **
        :: Copy a file to ALL USERS desktop
        
        @echo Off &cls &setlocal
        
        Set "SpecialFldr=Common Desktop"
        set "key=HKLM"
        
        Set "key=%key%\SOFTWARE\Microsoft\Windows\CurrentVersion"
        Set "key=%key%\Explorer\Shell Folders"
        :: note, Delims=<tab>
        For /f "tokens=2,* Delims=	" %%A in (
           'reg.exe query "%key%" /v "%SpecialFldr%"^|find/i "%SpecialFldr%"'
           ) do call set "SpecialFldr=%%~B"
        
        echo Destination Folder is "%SpecialFldr%"
        xcopy /D /y "\\server\share\folder\File.hta" "%SpecialFldr%\"

        \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

        Working...
        X