RAMI7250 Posted August 1, 2008 Share Posted August 1, 2008 (edited) hey, its rami, and i am breaking my head on that, but still cant find a solution:i have windows xp pro,and i want the logon script -thru Group Policy- will run just at once and not after etc logon.how can i do that?EDIT:====in search i was found that:if not exist %systemroot%\nameofile.txt (some commandsanother commandmore commands) > %systemroot%\nameofile.txtwhich needed to be in the a batch file at logon script at Group Policy.found here.what it means:some commandsanother commandmore commands?EDIT:==== solved.i was put an example batch test file which include the lines:if not exist %SYSTEMDRIVE%\text.txt (copy f:\test.txt c:\test.txt ) > %SYSTEMDRIVE%\test.txtwhich search if the file test.txt is not found on c:\. if its found he does nothing.if its not found it preform a copying command from to the text.txt file from f:\ to c:\ Edited August 1, 2008 by RAMI7250 Link to comment Share on other sites More sharing options...
delnic Posted November 3, 2009 Share Posted November 3, 2009 (edited) I've found a nifty way of creating a logon script that appends a line of text (or however many lines) to a pre-existing file (i.e. services file in etc folder)This can be put into the logon folder of a GPO to ensure the line is appended once only on logon, and never again@ echo offSETLOCAL ENABLEDELAYEDEXPANSIONIF EXIST "c:\done.txt" ( goto exit) ELSE ( echo test test test 1 2 3 4 5 >> c:\test.txt )( echo done > c:\done.txt):exitThis will check for the "done.txt: file, if its not there, it will add the desired text to the required file, then drop a file to say its done.On next logon, the logon script exits as it finds the check fileEasy as pie... If anyone has an easier way to do this please let me knowThanksNote the c:\test.txt should already exist Edited November 3, 2009 by delnic Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now