djfays
Messages postés2Date d'inscriptionmercredi 10 janvier 2007StatutMembreDernière intervention10 janvier 2007
-
10 janv. 2007 à 12:32
cs_JMO
Messages postés1854Date d'inscriptionjeudi 23 mai 2002StatutMembreDernière intervention24 juin 2018
-
10 janv. 2007 à 16:28
Bonjour, j'ai un script qui se lançait bien sous win2000, en changeant de poste avec winxp, ce script met un message d'erreur à la ligne 62, type incompatible: 'Copyfile'
Pourriez vous m'aidez à solutionner ce bug, je vous joins le script, et merci d'avance:
Const BSF_desktop = 0 'Desktop is the root directory. With BIF_returnonlyfsdirs circumvents problem with OK-button
Const BSF_internetexplorer = 1 'Internet Explorer is the root
Const BSF_programs = 2 'Programs folder of the start menu is the root
Const BSF_controlpanel = 3 'Control Panel is the root. Needs BIF_browseincludefiles
Const BSF_printers = 4 'Printers folder is the root. Needs BIF_browseincludefiles
Const BSF_documents = 5 'Documentsfolder is the root
Const BSF_favorites = 6 'Favorites is the root
Const BSF_startup = 7 'Startup-folder of the startmenu is the root. Needs BIF_browseincludefiles
Const BSF_recent = 8 'Recentfolder is the root. Needs BIF_browseincludefiles
Const BSF_sendto = 9 'Sendto-folder is the root. Needs BIF_browseincludefiles
Const BSF_recyclebin = 10 'Recycle Bin is the root. Needs BIF_browseincludefiles
Const BSF_startmenu = 11 'Start Menu is the root
Const BSF_desktopdirectory = 16 'The Desktopdirectory is the root directory
Const BSF_drives = 17 'The drives (My computer) folder is the root
Const BSF_network = 18 'The networkneighbourhood is the root
Const BSF_nethood = 19 'The nethoodfolder is the root
Const BSF_fonts = 20 'The fontsfolder is the root
Const BSF_templates = 21 'The templatesfolder is the root
Dim strPath
strPath = BrowseForFolder("Sélectionnez une ETIQUETTE :", BIF_editbox + BIF_validate + BIF_browseincludefiles, BSF_desktop)
If IsNull(strPath) Then
MsgBox "Selection invalide"
Else
MsgBox strPath
End If
'*****************
Dim Shell
Dim FileSystem
Dim WSHNetwork
Dim WSHShell
Dim FileSysObj
Dim monimprimante
Set Shell = wscript.createObject("wscript.shell")
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set FileSysObj = CreateObject("Scripting.FileSystemObject")
'monimprimante = "[file://\\mavwprd123\MAVOPAO001 \\mavwprd123\MAVOPAO001]"
cs_caramelmou
Messages postés56Date d'inscriptionjeudi 25 décembre 2003StatutMembreDernière intervention23 avril 20083 10 janv. 2007 à 13:29
Peut être qu'il suffirait d'ajouter un "*.etiq" après strPath (qui est en effet un chemin).
Ceci permet de copier sans message d'erreur tous les fichiers *.etiq à la racine, ce qui semble être le but du script (vu la suite).
djfays
Messages postés2Date d'inscriptionmercredi 10 janvier 2007StatutMembreDernière intervention10 janvier 20071 10 janv. 2007 à 14:11
en rajoutant "*.etiq" le message d'erreur a changé, toujours à la ligne 62 code erreur: 'fichirer introuvable'
Mon but est de récupérer via ce script un fichier se trouvant dans un répertoire serveur et de l'imprimer en local
cela marche avec un autre script qui me permet d'imprimer la totalité du répertoire, mais avec le second, le bug est avec un fichier choisi dans le répertoire.
Pourquoi sous win2000, ça marchait, et non pas avec winxp?????
Est-ce normal ?
If IsNull(strPath) Then
MsgBox "Selection invalide"
WScript.Quit
Else
MsgBox strPath
End If
et je n'ai pas compris:
wshShell.Run "cmd /C copy c:\*.etiq [file://\\mavwprd123\MAVOPAO001 \\mavwprd123\MAVOPAO001] & sleep 5 & del c:\*.etiq /F /Q"
et d'ailleurs, pourquoi utilises-tu la commande "cmd" ?
Pour le BrowseForFolder, j'ai pas tout saisi, dont les constantes.
J'essaierai demain au boulot avec une imprimante réseau.