Ok, I know how to pull information from a database with a record set, but I
was wondering if you could actually copy multiple files with it.
I'm trying to go through a series of folders that search for a reference
number, but the file ext can be different and the file isn't always jut the
ref number.
examples:
12345.zip
12345.ba1
12345.bad
12345pan.zip
etc.
folders include
prod
proto
hold
I have a script that will go through and find just the .zip files... I'll
post it incase anyone sees a easier fix.
This script is still in it's infant stages so I haven't gone through and
added everything it needs to do.
Thanks
On Error Resume Next
Set objExplorer = WScript.CreateObject _
("InternetExplorer.Application", "IE_")
Set objShell=CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim strZippedFile ' The full path/filename of the file to unzip
strCommandLine = "pspecs " & strONum
strView = "c:\view\"
objExplorer.Navigate "file:///C:\Scripts\dropdown.htm"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 250
objExplorer.Height = 175
objExplorer.Visible = 1
Do While (objExplorer.Document.Body.All.OKClicked.Value = "")
Wscript.Sleep 250
Loop
strType = objExplorer.Document.Body.All.OKClicked.Value
strONum = objExplorer.Document.Body.All.fldOrderNum.Value
objExplorer.Quit
Wscript.Sleep 250
If strType = "Cancelled" Then
Wscript.Quit
End If
If strONum = NULL Then
wscript.echo "Order number required"
Wscript.Quit
End If
' =====================================================================
' Locates file and copies it over
' =====================================================================
objShell.Run strCommandLine, 1, true
if strType = "Production" then
Dim strCopy, StrK, StrO, strcamb, strHold, strProd
strCopy = "c:\view\" & strONum & ".zip"
strK = "k:\prod\" & strONum & ".zip"
strO = "o:\prod\" & strONum & ".zip"
strcamb = "s:\cambak\prod\" & strONum & ".zip"
strHold = "k:\hold\prod\" & strONum & ".zip"
strProd = "o:\prod\" & intProd(strONum) & "\" & strONum & ".zip"
wscript.echo strProd
if objFSO.FileExists(strK) Then
wscript.echo "Found in the K"
objFSO.CopyFile strK, strCopy, true
elseif objFSO.FileExists(strO) then
wscript.echo "Found in the O"
objFSO.CopyFile strO, strCopy, true
elseif objFSO.FileExists(strcamb) then
wscript.echo "Found in the CAMBAK"
objFSO.CopyFile strcamb, strCopy, true
elseif objFSO.FileExists(strHold) then
wscript.echo "Found in the Hold"
objFSO.CopyFile strHold, strCopy, true
elseif objFSO.FileExists(strProd) then
wscript.echo "Found in the " & intProd(strONum)
objFSO.CopyFile strProd, strCopy, true
else
wscript.echo "File not found"
End if
else
strCopy = strview & "P" & strONum & ".rel"
strproto = "S:\MODEM\REL\P" & strONum & ".rel"
objFSO.CopyFile strProto, strCopy, true
wscript.echo "File Copied"
end if
strComLine2 = "c:\scripts\wzunzip c:\view\" & strONum & ".* c:\view"
objShell.Run strComLine2, 1, true
' =====================================================================
' End
' =====================================================================
Function intProd(ByVal intChar)
Select Case TRUE
Case intChar > 0 and intChar <= 5000
intProd = "01k-5k"
Case intChar > 5001 and intChar <= 10000
intProd = "05k-10k"
Case intChar > 10001 and intChar <= 15000
intProd = "10k-15k"
Case intChar > 15001 and intChar <= 20000
intProd = "15k-20k"
Case intChar > 20001 and intChar <= 25000
intProd = "20K-25k"
Case intChar > 25001 and intChar <= 30000
intProd = "25k-30k"
Case intChar > 30001 and intChar <= 35000
intProd = "30k-35k"
Case intChar > 35001 and intChar <= 40000
intProd = "35k-40k"
Case intChar > 40001 and intChar <= 45000
intProd = "40k-45k"
Case intChar > 45001 and intChar <= 50000
intProd = "45k-50k"
Case intChar > 50001 and intChar <= 55000
intProd = "50k-55k"
Case intChar > 55001 and intChar <= 60000
intProd = "55k-60k"
Case intChar > 60001 and intChar <= 65000
intProd = "60k-65k"
Case intChar > 65001 and intChar <= 70000
intProd = "65k-70k"
Case intChar > 70001 and intChar <= 75000
intProd = "70k-75k"
Case intChar > 75001 and intChar <= 80000
intProd = "75k-80k"
Case intChar > 80001 and intChar <= 85000
intProd = "80k-85k"
Case intChar > 85001 and intChar <= 90000
intProd = "85k-90k"
Case intChar > 90001 and intChar <= 95000
intProd = "90k-95k"
Case intChar > 95001 and intChar <= 100000
intProd = "95k-100k"
Case Else
intProd = "100K"
End Select
End Function