
Copiar un archivo con diferentes nombres
Publicado por Pedro Sergio (1 intervención) el 23/06/2015 00:43:16
Hola soy principiante en visual basic
Hola quiero saber como hacer una aplicacion sencilla que seleccione una archivo y lo renombre con un nombre especifico y solo cambiando la numeracion por ejemplo hasta ahora he usado este codigo muy simple...
Module Module1
Sub Main()
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\ÈÀÌÆ®½º¹Ì½º_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ç³Ê_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ç³Ê_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»Ç_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»Ç_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»ÇÆÄÄÚ_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»ÇÆÄÄÚ_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°ÁÈ¥_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°ÁÈ¥_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ã¼Ö_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ã¼Ö_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ç¼º_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ç¼º_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±×¸®ÆÙ·Î¾Â_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±×¸®ÆÙ·Î¾Â_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Â»Ç_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Â»Ç_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
End Sub
End Module
Me ha servido mucho pero es muy basico aunque si me ahorra trabajo ya que son mas de 180 archivos nuevos lo que estuve haciendo es con un procesador de texto sustituir la ruta del archivo principal "C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL" y el numero de serie "594"
hay alguna manera mas facil?
me estuve informando de los arrays pero no entiendo bien como trabajan Muchas gracias por su atencion
Hola quiero saber como hacer una aplicacion sencilla que seleccione una archivo y lo renombre con un nombre especifico y solo cambiando la numeracion por ejemplo hasta ahora he usado este codigo muy simple...
Module Module1
Sub Main()
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\ÈÀÌÆ®½º¹Ì½º_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ç³Ê_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ç³Ê_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»Ç_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»Ç_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»ÇÆÄÄÚ_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°Ë»ÇÆÄÄÚ_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°ÁÈ¥_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\°ÁÈ¥_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ã¼Ö_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ã¼Ö_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ç¼º_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Ç¼º_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±×¸®ÆÙ·Î¾Â_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±×¸®ÆÙ·Î¾Â_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Â»Ç_³²_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
' Copy the file to a new folder and rename it.
My.Computer.FileSystem.CopyFile(
"C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL",
"C:\Users\Roxas\Desktop\arianepalettes\palettesrenombrados\±Â»Ç_¿©_594.pal",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
End Sub
End Module
Me ha servido mucho pero es muy basico aunque si me ahorra trabajo ya que son mas de 180 archivos nuevos lo que estuve haciendo es con un procesador de texto sustituir la ruta del archivo principal "C:\Users\Roxas\Desktop\arianepalettes\Blanc\B Violet.PAL" y el numero de serie "594"
hay alguna manera mas facil?
me estuve informando de los arrays pero no entiendo bien como trabajan Muchas gracias por su atencion
Valora esta pregunta


0