Deploy hta

This topic contains 3 replies, has 2 voices, and was last updated by Avatar Max Dembo 10 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Avatar
    Max Dembo
    Member
    #143161

    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.

    Rems
    Rems
    Moderator
    #227506

    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

    Avatar
    Max Dembo
    Member
    #308233

    Re: Deploy hta

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

    Rems
    Rems
    Moderator
    #227508

    Re: Deploy hta

    Max Dembo;172876 wrote:
    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:
    :: ** [B]User Logon Script[/B] **
    :: Copy a file to Current User’s desktop

    @echo Off &cls &setlocal

    Set “SpecialFldr=Desktop”
    set “key=HKCU”

    Set “key=%key%SOFTWAREMicrosoftWindowsCurrentVersion”
    Set “key=%key%ExplorerShell Folders”
    :: [COLOR=”gray”][I]note, Delims=[/I][/COLOR]
    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 “[COLOR=”blue”]\serversharefolderFile.hta[/COLOR]” “%SpecialFldr%”

    sample of a StartupScript:

    Code:
    :: ** [B]Computer Startup Script[/B] **
    :: Copy a file to ALL USERS desktop

    @echo Off &cls &setlocal

    Set “SpecialFldr=Common Desktop”
    set “key=HKLM”

    Set “key=%key%SOFTWAREMicrosoftWindowsCurrentVersion”
    Set “key=%key%ExplorerShell Folders”
    :: [COLOR=”Gray”][I]note, Delims=[/I][/COLOR]
    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 “[COLOR=”Blue”]\serversharefolderFile.hta[/COLOR]” “%SpecialFldr%”

    Rems

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.