bat script for copying files

Home Forums Scripting General Scripting bat script for copying files

Viewing 1 post (of 1 total)
  • Author
    Posts

  • gogi100
    Member
    #142921

    I have this .bat script

    @echo
    off
    if not exist “fajl.dll” goto error:
    if not exist “fajl.ini” goto error:
    set xdir=%windir%system32
    if exist %windir%sysWOW64 set xdir=%windir%sysWOW64
    if not exist %xdir%folder goto error:
    cls

    net stop service
    copy /Y “fajl.dll” %xdir%folder
    copy /Y “fajl.ini” %xdir%folder
    %xdir%regsvr32.exe /s %xdir%folderfajl.dll
    echo.
    net start service

    echo.
    pause
    goto end:[/CODE]
    I tried starting this script over Active Directory: i choosed some user-properties-profile-logon script and put this script. When the user login again, it isn’t happen nothing. Beside this script there are more 3 files: .dll,.ini and .bat. These files i inserted in windows/sysvol/sysvol/mojdomen/scripts. From this code i see: the service stoped, next two files are copied in system32/folder, next the .dll file is registered and as a result the service is started. It seems all is ok, but this script don’t work. Where i maked mistakes.Maybe i don’t have administrator right. I also tried to use gpo in domain logon or startup script but nothing. Plz help me
    Thank’s[CODE]@echo off
    if not exist “fajl.dll” goto error:
    if not exist “fajl.ini” goto error:
    set xdir=%windir%system32
    if exist %windir%sysWOW64 set xdir=%windir%sysWOW64
    if not exist %xdir%folder goto error:
    cls

    net stop service
    copy /Y “fajl.dll” %xdir%folder
    copy /Y “fajl.ini” %xdir%folder
    %xdir%regsvr32.exe /s %xdir%folderfajl.dll
    echo.
    net start service

    echo.
    pause
    goto end:[/CODE]
    I tried starting this script over Active Directory: i choosed some user-properties-profile-logon script and put this script. When the user login again, it isn’t happen nothing. Beside this script there are more 3 files: .dll,.ini and .bat. These files i inserted in windows/sysvol/sysvol/mojdomen/scripts. From this code i see: the service stoped, next two files are copied in system32/folder, next the .dll file is registered and as a result the service is started. It seems all is ok, but this script don’t work. Where i maked mistakes.Maybe i don’t have administrator right. I also tried to use gpo in domain logon or startup script but nothing. Plz help me
    Thank’s

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Don't leave your business open to attack! Come learn how to protect your AD in this FREE masterclass!REGISTER NOW - Thursday, December 2, 2021 @ 1 pm ET

Active Directory (AD) is leveraged by over 90% of enterprises worldwide as the authentication and authorization hub of their IT infrastructure—but its inherent complexity leaves it prone to misconfigurations that can allow attackers to slip into your network and wreak havoc. 

Join this session with Microsoft MVP and MCT Sander Berkouwer, who will explore:

  • Whether you should upgrade your domain controllers to Windows Server
    2019 and beyond
  • Achieving mission impossible: updating DCs within 48 hours
  • How to disable legacy protocols and outdated compatibility options in
    Active Directory

Sponsored by: