Base de connaissance
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -50%
-50% Baskets Nike Air Huarache Runner
Voir le deal
69.99 €
Le deal à ne pas rater :
Réassort du coffret Pokémon 151 Électhor-ex : où l’acheter ?
Voir le deal

Movefile : déplacer ou renommer un fichier

Aller en bas

Movefile : déplacer ou renommer un fichier Empty Movefile : déplacer ou renommer un fichier

Message  Admin Ven 30 Jan - 15:59

METHOD: FileSystemObject.MoveFile

--------------------------------------------------------------------------------
Implemented in version 2.0

object.MoveFile source, destination

This method lets us move one or more files from one location ( the source) to another (destination). Wildcards can be used within the source string, providing it is the last component in the path, to enable the moving of multiple files, but cannot be used in the destination string. Note that if the source does contain wildcards, or if the destination ends with a back-slash (path separator), it is automatically assumed that the destination is an existing folder and any matching files are moved to it.

It is recommended that you use the FileExists method when moving a file - if a source file doesn't exist you'll get an error. An error also occurs if the destination is a directory or an existing file.

Code:
<%
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("c:\sourcefolder\anyfile.html") Then
filesys.MoveFile "c:\sourcefolder\anyfile.html", "c:\destfolder\"
End If
%>

Admin
Admin

Nombre de messages : 45
Date d'inscription : 20/01/2009

http://programming.formyjob.net

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum