打印

[求助] 自动删除desktop_.ini跟_desktop.ini的脚本

自动删除desktop_.ini跟_desktop.ini的脚本

批处理文件是这样的 WIN2K/XP系统
, k; E; ?1 f- Y$ V, r( j- x! \' P! k( h3 l0 r
@echo off8 g! g6 X/ l" t; x
del c:\\desktop_.ini /f/s/q/a
* l5 T/ U# Z) l) f+ w# Mdel d:\\desktop_.ini /f/s/q/a, C8 b. e! S" \% C' K& W
del e:\\desktop_.ini /f/s/q/a/ ^! b( t3 `/ r9 w: U( B/ P
del f:\\desktop_.ini /f/s/q/a: d2 i( q9 G' z5 X' w
del g:\\desktop_.ini /f/s/q/a* t( N1 _& H: s: D
del h:\\desktop_.ini /f/s/q/a2 w" L1 N) ?. x# q7 x) R0 j
del i:\\desktop_.ini /f/s/q/a
( r3 Q- b2 D1 [4 p- g5 @% Bdel j:\\desktop_.ini /f/s/q/a; u7 A2 M# G, k0 ~
del c:\\_desktop.ini /f/s/q/a0 I$ X# {$ {; G( n) D$ u: N
del d:\\_desktop.ini /f/s/q/a; _9 D, V9 p1 V8 {+ F3 o" ]' j
del e:\\_desktop.ini /f/s/q/a
0 h: z8 m. t, o0 U; ^del f:\\_desktop.ini /f/s/q/a
+ w) z- c4 O" v5 l5 }$ xdel g:\\_desktop.ini /f/s/q/a
- {$ i. D1 ]* \3 kdel h:\\_desktop.ini /f/s/q/a
/ R, r* ~; Z8 G4 F5 ddel i:\\_desktop.ini /f/s/q/a: C! u; G7 [9 W$ C0 Z
del j:\\_desktop.ini /f/s/q/a' y$ o( v# K0 q1 Z0 d9 e+ h
exit3 k( [) S" B2 q$ [/ E

5 J. I a% a, U
" G5 R% x, g" _8 \% ]6 _* Z但问题每个电脑分区不一样,如果能自动判定分区那就完美了。希望指教!! I. @ B. j5 O6 [
6 L' Z* `8 I# R3 J" _
[ 本帖最后由 adsladsl 于 2007-7-25 09:06 编辑 ]
本帖最近评分记录
  • mwpq 菊花元 +6 精品文章 2007-7-25 13:33

TOP

引用:
原帖由 adsladsl 于 2007-7-25 09:01 发表 2 h% t: x) q& }2 Y Y
批处理文件是这样的 WIN2K/XP系统
7 k& d0 ] f/ d" }* I- o9 c+ b" f8 q' t& [
@echo off
`! o- T: r9 x0 _del c:\\desktop_.ini /f/s/q/a
9 O. _0 r. q8 e( ndel d:\\desktop_.ini /f/s/q/a; N( ^! @- P6 P" y
del e:\\desktop_.ini /f/s/q/a
& w: x2 v* l6 I* h2 p4 }del f:\\desktop_.ini /f/s/q/a
. B) u0 R: D1 w1 c0 ~: |# F7 e0 Ndel g: ...
: p0 D! Q1 k* S% z% T Q3 q2 w/ a% F# |# x' I' H* \7 Q, j
我来个VBS版本的。
复制内容到剪贴板
代码:
Set fso = CreateObject("Scripting.FileSystemObject")
For Each dr In fso.Drives
If dr.IsReady=True then
sd1 = dr.DriveLetter & ":\"
If fso.FileExists(sd1&"desktop_.ini") then
Set f1=fso.GetFile(sd1&"desktop_.ini")
f1.Delete
Else
MsgBox(sd1&"desktop_.ini"&" Not Exits")
End If
If fso.FileExists(sd1&"_desktop.ini ") then
Set f2=fso.GetFile(sd1&"_desktop.ini ")
f2.Delete
Else
MsgBox(sd1&"_desktop.ini "&" Not Exits")
End if
End if
Next
还有搂住刚才说的分区的判断也一并附上:
复制内容到剪贴板
代码:
Set fso = CreateObject("Scripting.FileSystemObject")
For Each dr In fso.Drives
If dr.IsReady=True then
sd1 = dr.DriveLetter & ":\"
MsgBox ShowFileSystemType(sd1)
End if
Next
Function ShowFileSystemType(drvspec)
Dim fso, d, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(drvspec)
ShowFileSystemType = d.FileSystem
End Function
本帖最近评分记录
  • mwpq 菊花元 +10 谢谢帮助 2007-7-25 13:31

TOP