Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 06:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.