el subíndice está fuera del intervalo error 800A0009


03 de Marzo del 2017

Buenos días,

He cambiado un equipo con XP a w10 y un script que funciona con win WP me da error de "el subíndice está fuera del intervalo" con W10. ME da este error en la linea "Set f = fso.GetFolder(objArgs(0)) ".

A continuación os copio el script.:

'****************************************************************
'* Script Comprueba si hay archivos, ejecuta proceso y renombra *
'****************************************************************

'*** Declaro variables y creo objetos necesarios ***

Dim Ejecuta, return
Set objArgs = WScript.Arguments
Set WshShell = CreateObject("WScript.Shell")
Set WshNetwork = CreateObject("WScript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")

'*** Bucle de Cambio de nombre
Set f = fso.GetFolder(objArgs(0))
Set fc = f.Files
For Each f1 in fc

'*** Tratar los ficheros del directorio
nounom = "VACIO"

'*** JCT SI QUIERES TRATAR TODOS LOS FICHEROS DEL DIRECTORIO ELIMINA ESTA INSTRUCCION Y LA 'SIGUIENTE
If Left(UCase(f1.Name),3)= "ORD" Then

'*** PROCESAR FICHERO LEIDO
'WScript.Echo "procesar archivo leido"
command = "%COMSPEC% /k "

dos_command = "startrfc -3 -d DAP -u edi -p dav543 -c 100 -l ES -h 10.10.20.2 -s 00 -E PATHNAME=\10.10.53.2EDIVOXELIN"+f1.Name+ " -E PORT=DVG -F EDI_DATA_INCOMING -t"
'MsgBox dos_command

' Execute command.
WshShell.Run(command + dos_command)

'MsgBox "Fichero Procesado " + f1.Name

'*** nounom es el nombre del nuevo fichero
nounom = f1.name+".bak"

'*** ubinounom es la ubicacion y el nombre del nuevo fichero
ubinounom = "\10.10.53.2EDIVOXELIN"&nounom

'*** JCT SI QUIERES TRATAT TODOS LOS FICHEROS DEL DIRECTORIO ELIMINA ESTA INSTRUCCION Y LA 'SIGUIENTE
End If

'*** Comprobar si existe el fichero de destino, si no existe cambiar de nombre el de origen y 'moverlo a carpeta destino
If nounom <> "VACIO" and not(fso.FileExists(ubinounom)) Then
fso.CopyFile "\daesvpfs01EDIvoxelIN"&f1.Name, "\daesvpfs01EDIvoxelHISTORICO"&nounom

End if

Next


Muchas gracias