作者godelchen (godel)
看板Soft_Job
标题Re: [请益] 请问如何用记事本写批次备份档?
时间Sat Jul 26 23:55:49 2008
' Backing My PDA Phone's SD Card Content into PC without multimedia files
strComputer = "."
Set WshShell = WScript.CreateObject("WScript.Shell")
parameter = "u -r -m5 -ri6 -ilogD:\HermiteProfile\Desktop\SDBack.log
-xI:\Videos\*.* -xI:\Musics\*.* -xI:\AudioBooks\*.* -x*.tr3 D:\PDArchives.rar
I:\*.*"
WshShell.Run """c:\program files\utility\winrar\rar.exe""" & parameter
_________________________________________________________________
save above code into text files with extension vbs, like backup.vbs.
For parameter, you need to check up helpfile of winrar.
: 小妹我是在一间公司的资讯部门当小小的MIS助理
: 上个月主机AD的其中一颗硬碟挂点
: 现在已换新硬碟
: 不过工程师说批次备份档要重写
: 想把E:\的资料夹写到D
: 要写成rar的形式
: 有人懂我在说什麽吗?
: 工程师说他可以再另外找时间过来帮我写
: 可是我还是希望能自己学着写看看
: 但是我试了一下
: 发现还是没有头绪
: 公司只有我一个
: 主管在大陆了
: 所以没人可以帮我
: 因为公司的mis不需要会程式
: 所以我才可以进来上班...呜...
: 有哪位厉害的大大可以解救我一下吗...
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.133.133.85
1F:推 TonyQ:有bat不写干麽绕一圈作vbs再call shell... - -a 07/26 23:57
2F:→ godelchen:a mis better know why, especially she needs to 07/27 00:17
3F:→ godelchen:backup AD. BAT is for backward compatibility to DOS 07/27 00:17
4F:→ godelchen:NOT Microsoft's recommendation, or SOP. 07/27 00:19
5F:→ godelchen:follow this script you can go up to a very complex 07/27 00:22
6F:→ godelchen:application, but not with BAT. 07/27 00:22
7F:→ godelchen:This toy script i wrote for backing up my PDA, can 07/27 00:23
8F:→ godelchen:help her to adapt into other applications, just 07/27 00:24
9F:→ godelchen:replace "parameter" and the line after WhsShell.Run 07/27 00:25
10F:→ godelchen:With AD, OS locks some object for accessing, you 07/27 00:28
11F:→ godelchen:need vbs to call XXX to reach them. 07/27 00:29
12F:→ godelchen:however, it's ok at this place if it can be backuped 07/27 00:31
13F:→ godelchen:by winrar, she just need to read those parameters by 07/27 00:32
14F:→ godelchen:herself, i set those for my own use. 07/27 00:33
15F:→ godelchen:But i admit, TonyQ, for beginner, it's easier in BAT 07/27 00:39
16F:推 TonyQ:如果这种script不让 bat作 , 那我就不认为bat有存在的意义了 07/27 02:08
17F:→ TonyQ:ms-dos 本身就已经是一个颇完整的shell 平台了. bat反倒不是 07/27 02:09
18F:→ TonyQ:我相信不用提醒你 winrar是使用command line tool , not ap. 07/27 02:10
19F:→ TonyQ:人家说向下相容是指同系列的产品相容 , ms-dos反而还扩充了 07/27 02:12
20F:→ TonyQ:dos所没有的功能 , 这也是另一个点. 07/27 02:12
21F:→ TonyQ:每件事情存在都有其意义 . 07/27 02:12