Open an Administrator CMD Prompt

C:\>mkdir C:\Windows\System32\repl
C:\>mkdir C:\Windows\System32\repl\import
C:\>mkdir C:\Windows\System32\repl\import\scripts

Create a logon script in the scripts directory, e.g. logon.bat

Open Computer Management

C:\Windows\System32> mmc compmgmt.msc

Select the user account that you want to define the logon script for in Local Users and Groups/Users/username

Go to user properties/Logon script and add logon.bat into the Logon script box.

For “Home” versions of Windows
http://superuser.com/questions/258641/windows-7-home-how-to-configure-a-logon-script

Open an Administrator CMD Prompt

C:\>mkdir C:\Windows\System32\repl
C:\>mkdir C:\Windows\System32\repl\import
C:\>mkdir C:\Windows\System32\repl\import\scripts

Create a logon script in the scripts directory, e.g. logon.bat

C:\>net user username /scriptpath:logon.bat

To let the script finish executing, create a DWORD entry named RunLogonScriptSync at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon in the registry setting the value to 1.

https://technet.microsoft.com/en-us/library/cc962720.aspx

Example logon script:

@echo off

C:\Windows\System32\cmd.exe /c echo hi > C:\Users\username\Downloads\hi.txt
Advertisements