Framework .NET - el subíndice está fuera del intervalo error 800A0009

 
Vista:
sin imagen de perfil

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

Publicado por guillem (1 intervención) el 03/03/2017 11:04:46
Buenos días,

No se muy bien si estoy creando el mensaje en el post correcto, pero ahí va mi consulta.

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.:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
'****************************************************************
'* 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.2\EDI\VOXEL\IN\"+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.2\EDI\VOXEL\IN\"&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 "\\daesvpfs01\EDI\voxel\IN\"&f1.Name, "\\daesvpfs01\EDI\voxel\HISTORICO\"&nounom

End if

Next


Muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder