commande listing
Répondre à la discussion
Affichage des résultats 1 à 6 sur 6

commande listing



  1. #1
    invite7cc30736

    commande listing


    ------

    bonjour, j'utilise la commande " listing " depuis des années cette commande fonctionnait très bien jusqu'à ce jour elle me permettait de faire la liste du contenu d'un dossier et ce contenu était édité dans un fichier listing.txt donc depuis aujourd'hui cette commande ne fonctionne plus je clique avec le bouton droit de la souris sur un dossier un menu apparait avec la commande listing puis comme d'habitude une fenetre noire apparait ( le temps de lister mon dossier ) puis normalement un fichier listing.txt apparait sur mon disque C et bien depuis aujourd'hui ce fichier est vide quelqu'un peut il me dire comment réparer ce problème j'ai été dans le registre j'ai supprimé la commande listing je l'ai créée a nouveau et toujours rien
    merci à tous

    -----

  2. #2
    invite21b00a02

    Re : commande listing

    Bonjour jljais , quelques questions :

    1-Sous quel Windows ?
    2-Comment est cette commande "listing" ?
    3-Comment sa se présente dans la base de registre ?

    Merci d'avance

  3. #3
    invite7cc30736

    Re : commande listing

    merci de vous occuper de mon problème
    pourriez vous aller à l'adresse suivante où tout est expliqué mieux que je ne saurais le faire :

    http://www.commentcamarche.net/faq/2...s-d-un-dossier

    dans le bas de la page il y a un fichier pdf qui vous expliquera tout, il me semble que vous êtes expert en la matière et que vous comprendrez
    encore merci, je suis la toute la matinée pas cet après midi
    je vous souhaite un bon dimanche

  4. #4
    invite7cc30736

    Re : commande listing

    je suis sous windows xp pro avec le pack 3, j'avais oublié de vous le préciser merci

  5. A voir en vidéo sur Futura
  6. #5
    roro222

    Re : commande listing

    Bonjour
    Je te propose ce code qui fait exactement la chose que tu demande
    Copie le intégralement dans le bloc note et sauve le sur le bureau ou ailleur avec l'extention .vbs.
    Une fois sauvé, ne le déplace pas, sinon tu perdra cette fonction.

    Execute le de là ou tu l'a mis, il te mettra une option supplémentaire dans le menu contextuel qui te permet d'imprimer ou d'ouvrir dans le bloc note ton listing (répertoire ou Dir sous Dos)
    Code:
    ' ----------------------------------------------------------
    ' Script VBS d'impression ou affichage d'un répertoire 
    ' depuis le menu contextuel de l'explorateur de Windows 
    ' Il est autoinstallable par exécution sans paramètres
    ' ----------------------------------------------------------
    
    ' Constantes
    SW_HIDE	      = 0 
    SW_SHOWNORMAL = 1 
    ForReading = 1
    ForWriting = 2
    ' Tableau de correpsondance OEM->ANSI
    ' car la commande dir génère de l'OEM
    Dim oem
    oem=array( _
    "00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F", _
    "10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F", _
    "20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F", _
    "30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F", _
    "40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F", _
    "50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F", _
    "60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F", _
    "70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F", _
    "C7","FC","E9","E2","E4","E0","E5","E7","EA","EB","E8","EF","EE","EC","C4","C5", _
    "C9","E6","C6","F4","F6","F2","FB","F9","FF","D6","DC","F8","A3","D8","D7","83", _
    "E1","ED","F3","FA","F1","D1","AA","BA","BF","AE","AC","BD","BC","A1","AB","BB", _
    "A6","A6","A6","A6","A6","C1","C2","C0","A9","A6","A6","2B","2B","A2","A5","2B", _
    "2B","2D","2D","2B","2D","2B","E3","C3","2B","2B","2D","2D","A6","2D","2B","A4", _
    "F0","D0","CA","CB","C8","69","CD","CE","CF","2B","2B","A6","5F","A6","CC","AF", _
    "D3","DF","D4","D2","F5","D5","B5","FE","DE","DA","DB","D9","FD","DD","AF","B4", _
    "AD","B1","3D","BE","B6","A7","F7","B8","B0","A8","B7","B9","B3","B2","A6","A0")
    
    Dim ansi
    ansi=array( _
    "00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F", _
    "10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F", _
    "20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F", _
    "30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F", _
    "40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F", _
    "50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F", _
    "60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F", _
    "70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F", _
    "5F","5F","27","9F","22","2E","C5","CE","5E","25","53","3C","4F","5F","5A","5F", _
    "5F","27","27","22","22","07","2D","2D","7E","54","73","3E","6F","5F","7A","59", _
    "FF","AD","BD","9C","CF","BE","DD","F5","F9","B8","A6","AE","AA","F0","A9","EE", _
    "F8","F1","FD","FC","EF","E6","F4","FA","F7","FB","A7","AF","AC","AB","F3","A8", _
    "B7","B5","B6","C7","8E","8F","92","80","D4","90","D2","D3","DE","D6","D7","D8", _
    "D1","A5","E3","E0","E2","E5","99","9E","9D","EB","E9","EA","9A","ED","E8","E1", _
    "85","A0","83","C6","84","86","91","87","8A","82","88","89","8D","A1","8C","8B", _
    "D0","A4","95","A2","93","E4","94","F6","9B","97","A3","96","81","EC","E7","98")
    
    
    ' Variables
    Dim shell, args, fso, dirtemp, fictemp,ficoem, fictxt
    Set shell = WScript.CreateObject("WScript.Shell")
    Set fso   = WScript.CreateObject("Scripting.FileSystemObject")
    Set args  = Wscript.Arguments
    '
    Script=Lcase(Wscript.ScriptFullName)
    HelpFile=Left(Script,len(script)-3) & "hlp"
    If args.count=0 Then
    ' Auto-installation
    	Key="HKEY_CLASSES_ROOT\folder\shell\printdir\"
    	shell.RegWrite Key,"Impression du contenu du répertoire"
    	Command="wscript """ & Script & """ ""%L"""
    	shell.RegWrite Key & "command\",Command
    	MsgBox "Script "& Script &" installé", vbInformation, "Exécution dans une console"
    	WScript.quit
    	end if
    curdir=args(0)
    If right(curdir,1)="\" Then curdir=left(curdir,len(curdir)-1)
    Prompt="Indiquer le répertoire à imprimer, suivi du" & vbcrlf & _
    "critère de sélection éventuel, ainsi que des"  & vbcrlf & _
    "commutateurs habituels de la commande " & chr(34) & "dir" & chr(34) & "." _
    & vbcrlf & vbcrlf & _
    "(Appuyer sur le bouton d'aide pour plus de détails)"
    critere=InputBox(Prompt, "Impression de contenu de répertoire", _
    curdir & "\*.*",,,helpfile,1)
    If Len(critere)=0 Then Wscript.quit
    p=InStr(1,critere,"/",vbTextCompare)
    If p>0 then
    	switch=mid(critere,p)
    	critere=trim(left(critere,p-1))
    Else
    	switch=""
    	End If
    
    ' Création de nom de fichiers dans le répertoire temporaire
    
    Set dirtemp = fso.GetSpecialFolder(2)
    nomcmd = dirtemp & "\printdir.bat"
    nomoem = dirtemp & "\printdir.oem"
    nomtxt = dirtemp & "\printdir.txt"
    
    ' Fichier batch exécutant la commande "dir"
    ' avec sortie redirigée vers un fichier
    Set ficTemp = fso.CreateTextFile(nomcmd)
    fictemp.writeline "@echo off"
    fictemp.writeline ansi2oem("dir """ &  critere & """ " & switch & " > " & nomoem)
    ficTemp.close
    
    shell.Run nomcmd, SW_HIDE,true
    
    ' Retraitement du fichier résultats
    ' Conversion OEM -> ANSI
    Set ficoem=fso.OpenTextFile(nomoem, ForReading)
    Set fictxt=fso.OpenTextFile(nomtxt, ForWriting,true)
    While not ficoem.AtEndOfStream
    	oldline=ficoem.ReadLine
    	newline=""
    	For i = 1 To len(oldline)
    		oldc=asc(mid(oldline,i,1))
    		newc=oem(oldc)
    		newline=newline & chr(hextobyte(newc))
    		Next
    	fictxt.WriteLine newline
    	Wend
    fictxt.close
    ficoem.close
    
    prompt="Le contenu du répertoire a été stocké dans" & VBCRLF & _
    "le fichier " & nomtxt & VBCRLF & _
    "Appuyer sur :" & VBCRLF & _
    "  OUI pour l'imprimer" & VBCRLF & _
    "  NON pour l'ouvrir avec le bloc-notes"
    rep=MsgBox(prompt, vbYesNo + vbQuestion, curdir)
    
    If rep=vbYes Then 
    	commutateur=" /p " 
    	show=SW_HIDE
    else 
    	commutateur=" "
    	show=SW_SHOWNORMAL
    	end if
    ' Impression ou affichage du fichier à l'aide du bloc-notes
    commande=shell.ExpandEnvironmentStrings("%windir%\notepad.exe" &  commutateur & chr(34) & nomtxt & chr(34)) 
    shell.Run commande, show, true
    Wscript.quit
    
    ' Utilitaires de conversion hexadécimale
    ' -------------------------------------
    Function hextobyte(s)
    c1=Left(s,1)
    c2=Right(s,1)
    hextobyte=hextobin(c1)*16+hextobin(c2)
    End Function
    ' -------------------------------------
    Function hextobin(c)
    Select Case c
    	Case "0","1","2","3","4","5","6","7","8","9" 
    		hextobin=asc(c)-asc("0")		   
    	Case else
    		hextobin=asc(c)-asc("A")+10
    	End Select	
    End Function
    ' -------------------------------------
    Function ansi2oem(oldline)
    newline=""
    For i = 1 To len(oldline)
    	oldc=asc(mid(oldline,i,1))
    	newc=ansi(oldc)
    	newline=newline & chr(hextobyte(newc))
    	Next
    ansi2oem=newline
    end function
    ' -------------------------------------
    Le nombre d'imbéciles est incalculable,il y a de fortes probabilités que j'en suis

  7. #6
    invite7cc30736

    Re : commande listing

    merci roro222 pour ton aide , donc j'ai fait comme tu m'as dit, j'ai copié dans le bloc note ton code puis je l'ai sauvegardé sur mon disque c sous le nom : lister.vbs ensuite j'ai bien trouvé ce fichier sur le disque c , j'ai cliqué dessus et une fenêtre windows est apparue ( voir pièces jointes : le code ainsi que le message ) , j'espère ne pas avoir fait d'erreur
    a plus et bonne soirée

Discussions similaires

  1. Listing des dossiers command tree
    Par invite5820f017 dans le forum Programmation et langages, Algorithmique
    Réponses: 4
    Dernier message: 12/03/2013, 20h30
  2. listing de conférences
    Par invitee5c61975 dans le forum Actualités
    Réponses: 0
    Dernier message: 14/10/2008, 11h37
  3. Listing des formations secourisme
    Par invitec0091d34 dans le forum Secourisme spécial Croix-Rouge
    Réponses: 8
    Dernier message: 11/06/2007, 22h15
  4. Listing des apn
    Par invite9a8c8cd0 dans le forum Matériel astronomique et photos d'amateurs
    Réponses: 21
    Dernier message: 13/05/2007, 10h27
  5. Impossible de démarrer - PCI device listing
    Par invitedffa5b52 dans le forum Matériel - Hardware
    Réponses: 1
    Dernier message: 14/02/2005, 17h02
Dans la rubrique Tech de Futura, découvrez nos comparatifs produits sur l'informatique et les technologies : imprimantes laser couleur, casques audio, chaises gamer...