China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-07 00:59
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How do I use a batch file to record daily operations??? View 991 Replies 6
Original Poster Posted 2007-12-23 20:16 ·  中国 河南 南阳 联通
初级用户
Credits 110
Posts 45
Joined 2007-01-07 00:00
19-year member
UID 75756
Gender Male
Status Offline
Can anyone help me write a batch file like this?

(1) When this batch file is opened, it should start recording the user's operation records while using the computer, and save those files and folders the user opens as shortcuts into a specified folder (I know the system itself will save the user's operation records under the C:\Documents and

Settings\Administrator\Recent

directory, but this is easy for anyone with a little computer knowledge to notice).

(2) When running this batch file, it should run in the background, that is, with no window, and not even minimized on the taskbar.
Floor 2 Posted 2007-12-23 20:18 ·  中国 河南 南阳 联通
初级用户
Credits 110
Posts 45
Joined 2007-01-07 00:00
19-year member
UID 75756
Gender Male
Status Offline
Sorry, after I posted the new topic, I refreshed three times, and ended up making three duplicate topics. I'm really sorry!!!:(
Floor 3 Posted 2007-12-23 20:32 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 109
Posts 40
Joined 2007-12-22 15:41
18-year member
UID 106471
Gender Male
Status Offline
I have an idea, just don't know how to do it

If you use vbs to start the batch, it can probably achieve the effect of running in the background, but in the process manager there will be a cmd process

You can use the command
copy C:\Documents and

Settings\Administrator\Recent


contents inside, then clear it, and use a delay command to control the copy speed

Then keep looping


-------------- A bit messy
Floor 4 Posted 2007-12-23 20:42 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 109
Posts 40
Joined 2007-12-22 15:41
18-year member
UID 106471
Gender Male
Status Offline
Hehe, I wrote one

A bit crude, you can modify it yourself
-----------------------------
@echo off
:a
copy C:\"Documents and Settings\Administrator"\Recent\*.* d:\记录\
del /f /q C:\"Documents and Settings\Administrator"\Recent\*.*
ping 127.255.255.255 -n 1 -w 5000 >nul
goto a
-------------------------------------------------

5000 means looping once every 5 seconds


Hope this is the effect you want QQ 236189165

If you run it with vbs, you can achieve the effect of running in the background

[ Last edited by mayu2004 on 2007-12-23 at 08:43 PM ]
Floor 5 Posted 2007-12-23 21:05 ·  中国 河南 南阳 联通
初级用户
Credits 110
Posts 45
Joined 2007-01-07 00:00
19-year member
UID 75756
Gender Male
Status Offline
Thanks to the brother in the previous post for the reply. I thought of doing it this way at first too, but in the end I felt that doing this might waste a bit too much system memory, right? But I'll add credits to you tomorrow, today the credits I've added already exceeded my limit!
Floor 6 Posted 2007-12-23 21:42 ·  中国 河南 南阳 联通
初级用户
Credits 110
Posts 45
Joined 2007-01-07 00:00
19-year member
UID 75756
Gender Male
Status Offline
I'm a super newbie. I wrote the VBS file below, but it still won't run. Can someone help take a look

ah!!

dim path_1="I:\Documents and Settings\Administrator\Recent"

dim path_2="D:\记录"

dim processNames,processName

processNames=Array("WangWang.exe","QQ.exe","eMule.exe") 'Forbid running WangWang, QQ, eMule, Xunlei, Fetion

set FSO=wscript.createObject("scripting.FileSystemObject")

set f_1=FSO.getFile(path_1)

do

call copy()

wscript.sleep 2500

call killProcess()

wscript.sleep 2500

loop

sub copy() 'Function for copying files

f_1.copy(path_2) 'Copy the files in the path_1 folder to the path_2 folder

end sub

sub killProcess() 'Function for forbidding specified processes from running

on Error resume next

Set objWMIService=GetObject("winmgmts:{impersonationLevel=Impersonate}!root\cimv2")

for each ProcessName in ProcessNames

Set colProcessList=objWMIService.execquery(" Select * From win32_process where name = '" & ProcessName & "' ")

For Each objProcess in colProcessList

objProcess.terminate()

wscript.sleep 3000

end sub
Floor 7 Posted 2007-12-24 08:33 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 109
Posts 40
Joined 2007-12-22 15:41
18-year member
UID 106471
Gender Male
Status Offline
I don't understand vbs, but if you use a batch file and set the delay a bit higher,

there should be no problem

I tested it on my machine

the memory can be kept under 5m
Forum Jump: