Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
| Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 29th, 2018, 09:57 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript error runtime error: File not found

Gentlemen
I'm running a vbs to which it performs folder checking and checks if files have been left standing for more than an hour in some folders. The process is displaying the following error:
D: \ Control-M \ monitora_pedido.vbs (47, 3) Microsoft VBScript runtime error: File not found

The following is vbscript:

Dim SizeFile, NameFile, DateFile, SearchFile, dtmThisDay, dtmThisMonth, dtmThisYear, dtmThisHour, _
dtmThisMinute, dtmThisSecond, DateLastFile, strts, cont, flag, FileDirLog, ExitCode, vetorpasta(1)

'Inicializa as variaveis do timestamp
dtmThisDay = Day(Date)
dtmThisMonth = Month(Date)
dtmThisYear = Year(Date)
dtmThisHour = Hour(Time)
dtmThisMinute = Minute(Time)
dtmThisSecond = Second(Time)
ExitCode = 0

'Cria objetos
Set objShell = CreateObject("Shell.Application")
Set objfso = CreateObject("Scripting.FileSystemObject")
'Cria objetos Pedidos
vetorpasta(1) = "\\SERVER1\root$\FILES\PROCESSED\REQUEST"

'Cria arquivo de logs
FileDirLog = "D:\Control-M\LOG\Log_PEDIDOSOUT"&dtmThisDay&dtmThisMonth&dtmT hisYear&dtmThisHour&dtmThisMinute&dtmThisSecond&". txt"
Set arqWrite = objFSO.OpenTextFile(FileDirLog, 8, True)

For i = 1 to 1
Set ObjPasta = objfso.GetFolder(vetorpasta(i))
Set objArquivosExistentes = objPasta.Files

for each arquivo in objArquivosExistentes
NameFile = arquivo.Name
DateFile = arquivo.DateCreated
dblDifHoras = DateDiff("s", DateFile, now)
CalculaHora = dblDifHoras \ 60
if CalculaHora > 30 then
strts = "Arquivo "&NameFile&" na pasta "&vetorpasta(i)&" desde as "&DateFile
arqWrite.WriteLine(strts)
End if
next
Next

arqWrite.Close()

Set Filelog = objFso.GetFile(FileDirLog)
Set Filelog1 = objFSO.OpenTextFile(FileDirLog)
SizeFile = Filelog.Size '\1024
'msgbox SizeFile
If SizeFile > 0 Then
While Filelog1.AtEndOfStream <> True
x = Filelog1.ReadLine
wScript.echo(x)
Wend
ExitCode = 5
End If
Filelog1.Close()
Filelog.Delete(force)

'DesconstruĆ§Ć£o dos objetos que foram ulizados no ambiente
Set objfso = Nothing
Set Pasta = Nothing
Set objArquivosExistentes = Nothing
Set objTextFile = Nothing
WScript.Quit ExitCode
Reply With Quote


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript runtime error '800a000d' error futurehype Classic ASP Professional 20 May 23rd, 2011 10:47 PM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Basics 1 July 21st, 2006 11:43 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Professional 1 July 21st, 2006 11:42 AM
Microsoft VBScript runtime error '800a000d' mwlyoung Classic ASP Databases 3 April 15th, 2004 04:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.