|
Answer» I do have a question on a batch file if you do not mind. I am creating this batch file below: 1. Create a batch file, Micr.bat, which will accomplish the following: a. Update a log file on your C:\root folder. Call this log file cleanup.log. Each time your batch file is run it should over-write this log file which CONTAINS the User Name (utilizing the %USERPROFILE% environmental variable), b. Merge this file onto the back-end of the file cleanup.hst which will also be stored in the C:\ root folder. c. List the directory contents of this TEMP folder. d. Ask for the user’s permission to proceed with the deletion of all these files. E. If the user responds positively, then delete all the files from the user’s TEMP file. f. Remember to copy the textbook’s REPLY.COM to the folder containing your batch file. g. Place this batch file in the C:\BatchFiles folder. This is what I have come up with: @echo off rem (BAT) rem (EVA) rem (dec 2 2004) FOR %%a IN (%USERS%) DO IF "%1"=="%%a" GOTO OKAY :NO ECHO YOU, %1, are NOT allowed in the system. GOTO END KAY ECHO Welcome %1 to the system. :END c:\setup.exe /L2 c:\Logfiles\cleanup.log c:\ move cleanup.log a:\cleanup.hst c:\ dir /TEMP REM This Batch program DELETES all files in the TEMP folder in the current folder. REM I will give the user to react and abort this process. @ECHO OFF ECHO WARNING: Going to delete all files in the temp folder ECHO Press CTRL+C to abort or simply press a key to continue. PAUSE DEL TEMP *.* c:\ copy REPLY.com C:\EVA IF %1==Eva GOTO EVA Echo Is anyone there? GOTO FINISH :end Can you please tell me if i am on the correct track?I can't give you much advice on batch files (I rarely use them anymore) but your logic seems to be correct, although I believe you mis-spelled the word "OKAY" in line 10.Thank you.
I was really not to sure where "forum topic" to send my issue. Well I guess I am were I was before I made the post.
I APOLOGIZE for the repeated posts.
|