Ceriwis

Ceriwis (https://forum.ceriwis.com/forum.php)
-   Shareware & Freeware (https://forum.ceriwis.com/forumdisplay.php?f=64)
-   -   1 file copy ke banyak folder VBscript atau BAT jg boleh (https://forum.ceriwis.com/showthread.php?t=2473737)

Syahrani10 24th October 2012 02:46 PM

1 file copy ke banyak folder VBscript atau BAT jg boleh
 

izin koreksi master untuk script VBs,BAT,atau apajalah



pertanyaanya ada yg punya resep lebih simple gk ya?



cth1


Code:

mover.vbsSet fso=CreateObject("Scripting.FileSystemObject")
source="d:\path1\"
target="d:\path2\"

Set fldr=fso.getFolder(source)
for each file in fldr.files
if right(lcase(file.name),4)=".pdf" then
call mover(lcase(file.path))
end if
next

sub mover(f1)
f2=replace(f1,"pdf","txt")
if fso.fileExists(f2) then
fso.MoveFile f1,target
fso.MoveFile f2,target
wscript.sleep 60000
end if
end sub

cth2


Code:

Const OverwriteExisting = True
Set objArgs = WScript.Arguments
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objArgs.Count < 1 Then
MsgBox "Thanks but.. Wrong!!" & vbCRLF & _
"" & vbCRLF & _
"Select a file in Explorer, drag and drop it on the script." & vbCRLF & _
"Or place a shortcut from the script into the SendTo folder" & vbCRLF & _
"This way the script will show in the sendto right click menu ." & vbCRLF & _
"" & vbCRLF & _
"To edit the sendto menu go to 'Start - Run - Sendto - OK" & vbCRLF & _
"Place the shortcut from DropFile.vbs in the SendTo folder, now right click a file and 'Send To'DropFile", _
vbInformation + vbOKOnly, Title
WScript.Quit
End If


For I = 0 to objArgs.Count - 1

Arg = objArgs(I)

objFSO.CopyFile Arg, "C:\DestFolder01\", OverwriteExisting
objFSO.CopyFile Arg, "D:\DestFolder02\", OverwriteExisting
objFSO.CopyFile Arg, "E:\DestFolder03\", OverwriteExisting
objFSO.CopyFile Arg, "F:\DestFolder04\", OverwriteExisting
objFSO.CopyFile Arg, "G:\DestFolder05\", OverwriteExisting

Next
WScript.Quit

contoh lainya dari sini

</div>


All times are GMT +7. The time now is 10:17 PM.