IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Scripts/Batch Discussion :

Protéger dossier / XP / avec raccourci sur le fond d'écran


Sujet :

Scripts/Batch

  1. #1
    Membre actif Avatar de GADENSEB
    Homme Profil pro
    Responsable Administratif et Financier
    Inscrit en
    Mars 2014
    Messages
    569
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Responsable Administratif et Financier
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2014
    Messages : 569
    Points : 285
    Points
    285
    Par défaut Protéger dossier / XP / avec raccourci sur le fond d'écran
    Salut
    J'essaye d'adapter le super code d'Hackoo --> ici
    A windows XP

    Le dossier caché est Baba

    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    @echo off
    Color 9B
    title Protection avec mot de passe ^| Version 1.5 by Hackoo
    mode con cols=67 lines=20
    Set MyVBSFile=%tmp%\%~n0.vbs
    Set MyHTAFile=%tmp%\%~n0.hta
    if EXIST "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}" goto saisiePass
    if NOT EXIST Baba goto create
    reg query ""HKLM\SOFTWARE\Baba"">Nul
    if %errorlevel%==1 goto pasdepass
     
    :confirm
    echo Voulez-vous verrouiller le dossier Baba ?( O/N )
    set /p "choix=>"
    if %choix%==O goto ferme
    if %choix%==o goto ferme
    if %choix%==n goto fin
    if %choix%==N goto fin
    echo Choix incorrect, veuillez répondre Oui ou Non.
    goto confirm
     
    :ferme
    cls
    Color 9A
    ren "%~dp0Baba" "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    attrib +h +s "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    echo.
    echo.
    echo.
    echo                             _####_
    echo                            #      #
    echo                           #        #
    echo                           #        #
    echo                           #        #
    echo                         ##############
    echo                        #              #
    echo                        #              #
    echo                        #      ##      #
    echo                        #     ####     #
    echo                        #     ####     #
    echo                        #      ##      #
    echo                        #      ##      #
    echo                        ################
    echo.
    echo.                  Dossier Baba verouillée
    echo. 
    echo. 
    goto fin
     
    :SaisiePass
    echo.
    echo         Veuillez saisir le mot de passe du Dossier Baba.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    Del "%MyVBSFile%" & Del "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "passout=%%i"
    echo.
    echo              V,rification du mot de passe en cours ....
    for /f "tokens=3" %%i in ('reg query ""HKLM\SOFTWARE\Baba"" ^| find "MDP"') do set MDP=%%i
    Del %tmp%\userIn
    if %passout%==%MDP% goto ouvre
    if NOT %passout%==%MDP% goto incorrect
    goto fin
     
    :pasdepass
    cls
    echo                Aucun mot de passe n'est défini.
    echo     Veuillez définir un mot de passe pour le dossier Baba.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    echo.
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "newpass1=%%i"
    echo        Veuillez confirmer de nouveau votre mot de passe
    Call :CreateMyVBS
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "newpass2=%%i"
     
    if "%newpass1%"=="%newpass2%" goto AjoutPassReg
    if Not "%newpass1%"=="%newpass2%" echo Les Deux mots de passes ne sont pas identiques ? 
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Del "%MyVBSFile%" & Del "%MyHTAFile%" & Del %tmp%\userIn
    goto pasdepass
    goto fin
    :AjoutPassReg
    reg Add ""HKLM\SOFTWARE\Baba"" /v MDP /t REG_SZ /d %newpass2% > NUL
    goto ferme
    goto fin 
    :incorrect
    cls
    Color BC & echo.
    echo                  Mot de passe incorrect ? ? ?
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Goto ping
     
    :create
    md "%~dp0Baba"
    echo.
    echo.  
    echo.
    echo.                       
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #     Le dossier Baba est cr,e      #
    echo  #    #     #                                         #
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
    goto CreateShortcut
    goto pasdepass
     
    :ouvre
    cls
    attrib -h -s "%~dp0Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    ren "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}" Baba
    Color 9A
    echo.
    echo. 
    echo.
    echo.                        
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #       Mot de passe est Correct !        #
    echo  #    #     #     Le dossier Baba est ouvert ! #                                   
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
     
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Start Explorer "%~dp0Baba"
    exit
    :Ping
    cls
    echo                     Mot de passe incorrect ? ? ?
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    goto SaisiePass
    :fin
    Timeout /NOBREAK /T 5 > Nul
    Exit /b
    :#Start
    <html>
    <head>
    <title>Mot de Passe © Hackoo</title>
    <hta:application id="htaid"
    applicationName="Password"
    border="thin"
    icon="wlrmdr.exe"
    borderStyle="normal"
    caption="yes"
    contextMenu="no"
    maximizeButton="no"
    minimizeButton="yes"
    navigable="yes"
    showInTaskbar="yes"
    singleInstance="yes"
    sysmenu="yes"
    SCROLL="NO" 
    SHOWINTASKBAR="Yes"   
    SELECTION="no"
    MINIMIZEBUTTON="no" 
    >
    </head>
    <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES"> 
    <BODY TOPMARGIN="1" LEFTMARGIN="1"><CENTER><DIV><SPAN ID="ONSCR"></SPAN></DIV></CENTER></BODY>
    <script language="vbscript">
    '---------------------------------------------------------------------------------------
    Sub Window_OnLoad
        CenterWindow 300,150
        Call PasswordForm()
        Call TextFocus()
    end sub
    '---------------------------------------------------------------------------------------
    Sub CenterWindow(x,y)
        Dim iLeft,itop
        window.resizeTo x,y
        iLeft = window.screen.availWidth/2 - x/2
        itop = window.screen.availHeight/2 - y/2
        window.moveTo ileft,itop
    End Sub
    '----------------------------------------------------------------------------------------
    Sub SavePassword()
        set fs=CreateObject("Scripting.FileSystemObject")
        strFile=fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2),"UserIn"))
        set ts=fs.OpenTextFile(strFile,2,True)
        If PasswordArea.value <> "" Then
            ts.WriteLine PasswordArea.value
            ts.Close
            self.Close 'Pour fermer ce HTA après avoir enregistré le mot de passe comme une variable dans le fichier Userin
        else
            Msgbox "Le mot de passe est vide ! "& Vbcrlf & "SVP entrez de nouveau votre mot de passe",VbExclamation,"Mot de Passe © Hackoo"
            Location.reload(true) 'Pour recharger à nouveau ce HTA
        end if
    End Sub
    '----------------------------------------------------------------------------------------
    Sub PasswordForm()
        Self.document.title = "Mot de Passe © Hackoo"
        Self.document.bgColor = "lightblue"
        ONSCR.InnerHTML="<center><FONT COLOR=""#FFFFFF"" SIZE=""+1"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Taper votre mot de passe</FONT<br>"_
        &"<input type=""password"" name=""PasswordArea"" size=""20"" onKeyUp=""TextFocus""><P>"_
        &"<input type=""Submit"" STYLE=""HEIGHT:25;WIDTH:110"" value=""OK"" onClick=""SavePassword"">"
    END Sub
    '----------------------------------------------------------------------------------------
    Sub TextFocus
        PasswordArea.Focus 
    End Sub
    '----------------------------------------------------------------------------------------
    </script>
    </body>
    </html>
    :#End
    ::***********************************************************************************************
    :CreateMyVBS
    ::'**********************************************************************************************
    (
    echo. Set fso = CreateObject^("Scripting.FileSystemObject"^)
    echo. Set f=fso.opentextfile^("%~f0",1^)
    echo. a=f.readall
    echo. Set r=new regexp
    echo. r.pattern = "(?:^|(?:\r\n))(?::#Start\r\n)([\s\S]*?)(?:\r\n)(?::#End)"
    echo. Set Matches = r.Execute^(a^)
    echo. If Matches.Count ^> 0 Then Data = Matches^(0^).SubMatches^(0^)
    echo. WriteFileText "%MyHTAFile%",Data
    echo. f.close
    ::'**********************************************************************************************
    echo. 
    echo. Function WriteFileText^(sFile,Data^)
    echo.     Dim objFSO,oTS,sText
    echo.     Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
    echo.     Set oTS = objFSO.CreateTextFile^(sFile,2^)
    echo.     oTS.WriteLine Data
    echo.     oTS.close
    echo.     set oTS = nothing
    echo.     Set objFSO = nothing
    echo. End Function 
    ) > %MyVBSFile%
    ::'***********************************************************************************************
    :CreateShortcut
    (
    echo Call Shortcut("%~f0","Private"^)
    echo ^'**********************************************************************************************^)
    echo Sub Shortcut(CheminApplication,Nom^)
    echo     Dim objShell,DesktopPath,objShortCut,MyTab
    echo     Set objShell = CreateObject("WScript.Shell"^)
    echo     MyTab = Split^(CheminApplication,"\"^)
    echo     If Nom = "" Then
    echo     Nom = MyTab(UBound^(MyTab^)^)
    echo     End if
    echo     DesktopPath = objShell.SpecialFolders("Desktop"^)
    echo     Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
    echo     objShortCut.TargetPath = Dblquote^(CheminApplication^)
    echo    objShortCut.WorkingDirectory = "%~dp0"
    echo     ObjShortCut.IconLocation = "wlrmdr.exe,0"
    echo     objShortCut.Save
    echo End Sub
    echo ^'**********************************************************************************************
    echo ^'Fonction pour ajouter les doubles quotes dans une variable
    echo Function DblQuote(Str^)
    echo     DblQuote = Chr(34^) ^& Str ^& Chr^(34^)
    echo End Function
    echo ^'**********************************************************************************************
    ) > %temp%\Shortcutme.vbs
    Start  %temp%\Shortcutme.vbs
    Timeout /NOBREAK /T 2 > Nul
    Del %temp%\Shortcutme.vbs
    ::******************************************************************************

    Mais j'ai message d'erreur bizarre
    Nom : Sans titre.JPG
Affichages : 145
Taille : 11,4 Ko

    donc cela coince ici

    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    :CreateShortcut
    (
    echo Call Shortcut("%~f0","Private"^)
    echo ^'**********************************************************************************************^)
    echo Sub Shortcut(CheminApplication,Nom^)
    echo     Dim objShell,DesktopPath,objShortCut,MyTab
    echo     Set objShell = CreateObject("WScript.Shell"^)
    echo     MyTab = Split^(CheminApplication,"\"^)
    echo     If Nom = "" Then
    echo     Nom = MyTab(UBound^(MyTab^)^)
    echo     End if
    echo     DesktopPath = objShell.SpecialFolders("Desktop"^)
    echo     Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
    echo     objShortCut.TargetPath = Dblquote^(CheminApplication^)
    echo    objShortCut.WorkingDirectory = "%~dp0"
    echo     ObjShortCut.IconLocation = "wlrmdr.exe,0"
    echo     objShortCut.Save
    echo End Sub
    echo ^'**********************************************************************************************
    echo ^'Fonction pour ajouter les doubles quotes dans une variable
    echo Function DblQuote(Str^)
    echo     DblQuote = Chr(34^) ^& Str ^& Chr^(34^)
    echo End Function
    echo ^'**********************************************************************************************
    ) > %temp%\Shortcutme.vbs
    Start  %temp%\Shortcutme.vbs
    Timeout /NOBREAK /T 2 > Nul
    Del %temp%\Shortcutme.vbs
    ::******************************************************************************

    Pourtant cela me semble correct....... je pige pas


    ou est-ce la clé de registre qui coince ?
    {2227A280-3AEA-1069-A2DE-08002B30309D}


    QQn aurait une idée ?

    Bonne soirée
    Bonne journée
    Seb



    ###############################
    C'est Totomatique, On va tout Totomate-isé ;-)
    ###############################

  2. #2
    Membre actif Avatar de GADENSEB
    Homme Profil pro
    Responsable Administratif et Financier
    Inscrit en
    Mars 2014
    Messages
    569
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Responsable Administratif et Financier
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2014
    Messages : 569
    Points : 285
    Points
    285
    Par défaut
    J'ai essayé avec la clef de registre

    {21EC2020-3AEA-1069-A2DD-08002B30309D}

    mais pas mieux !
    Bonne journée
    Seb



    ###############################
    C'est Totomatique, On va tout Totomate-isé ;-)
    ###############################

  3. #3
    Membre éclairé Avatar de devilsnake88
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Janvier 2013
    Messages
    453
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Janvier 2013
    Messages : 453
    Points : 809
    Points
    809
    Par défaut
    Question toute bête, est-ce que "Shortcutme.vbs" est bien dans %temp%?
    Et évite de laisser un script dans un dossier temporaire...
    ________________________________________________________________
    N'oublie pas de faire une sauvegarde avant d'exécuter des scripts...
    Si j'ai ton problème, un petit fait toujours plaisir!
    ________________________________________________________________

  4. #4
    Membre actif Avatar de GADENSEB
    Homme Profil pro
    Responsable Administratif et Financier
    Inscrit en
    Mars 2014
    Messages
    569
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Responsable Administratif et Financier
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2014
    Messages : 569
    Points : 285
    Points
    285
    Par défaut
    Ben c'est bizarre

    Le dossier Baba est bien crée mais shotcutme.vbs n’apparaît nul part ....comme s'il n'était pas crée....

    Aprés on peut tjrs dépalcer dans un autre dossier que temp
    Bonne journée
    Seb



    ###############################
    C'est Totomatique, On va tout Totomate-isé ;-)
    ###############################

  5. #5
    Membre actif Avatar de GADENSEB
    Homme Profil pro
    Responsable Administratif et Financier
    Inscrit en
    Mars 2014
    Messages
    569
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Responsable Administratif et Financier
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2014
    Messages : 569
    Points : 285
    Points
    285
    Par défaut
    je viens d'essayer en déplaçant des fichiers temp dans
    C:\Protection

    Il ne trouve pas Shortcutme.vbs....

    bizarre


    J'en suis là du coup


    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    @echo off
    Color 9B
    title Protection avec mot de passe ^| Version 1.5 by Hackoo
    mode con cols=67 lines=20
    Set MyVBSFile=%tmp%\%~n0.vbs
    Set MyHTAFile=%tmp%\%~n0.hta
    if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto saisiePass
    if NOT EXIST Baba goto create
    reg query ""HKLM\SOFTWARE\Baba"">Nul
    if %errorlevel%==1 goto pasdepass
     
    :confirm
    echo Voulez-vous verrouiller le dossier Baba ?( O/N )
    set /p "choix=>"
    if %choix%==O goto ferme
    if %choix%==o goto ferme
    if %choix%==n goto fin
    if %choix%==N goto fin
    echo Choix incorrect, veuillez répondre Oui ou Non.
    goto confirm
     
    :ferme
    cls
    Color 9A
    ren "%~dp0Baba" "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    echo.
    echo.
    echo.
    echo                             _####_
    echo                            #      #
    echo                           #        #
    echo                           #        #
    echo                           #        #
    echo                         ##############
    echo                        #              #
    echo                        #              #
    echo                        #      ##      #
    echo                        #     ####     #
    echo                        #     ####     #
    echo                        #      ##      #
    echo                        #      ##      #
    echo                        ################
    echo.
    echo.                  Dossier Baba verouillée
    echo. 
    echo. 
    goto fin
     
    :SaisiePass
    echo.
    echo         Veuillez saisir le mot de passe du Dossier Baba.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    Del "%MyVBSFile%" & Del "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "passout=%%i"
    echo.
    echo              V,rification du mot de passe en cours ....
    for /f "tokens=3" %%i in ('reg query ""HKLM\SOFTWARE\Baba"" ^| find "MDP"') do set MDP=%%i
    Del %tmp%\userIn
    if %passout%==%MDP% goto ouvre
    if NOT %passout%==%MDP% goto incorrect
    goto fin
     
    :pasdepass
    cls
    echo                Aucun mot de passe n'est défini.
    echo     Veuillez définir un mot de passe pour le dossier Baba.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    echo.
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "newpass1=%%i"
    echo        Veuillez confirmer de nouveau votre mot de passe
    Call :CreateMyVBS
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "newpass2=%%i"
     
    if "%newpass1%"=="%newpass2%" goto AjoutPassReg
    if Not "%newpass1%"=="%newpass2%" echo Les Deux mots de passes ne sont pas identiques ? 
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Del "%MyVBSFile%" & Del "%MyHTAFile%" & Del %tmp%\userIn
    goto pasdepass
    goto fin
    :AjoutPassReg
    reg Add ""HKLM\SOFTWARE\Baba"" /v MDP /t REG_SZ /d %newpass2% > NUL
    goto ferme
    goto fin 
    :incorrect
    cls
    Color BC & echo.
    echo                  Mot de passe incorrect ? ? ?
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Goto ping
     
    :create
    md "%~dp0Baba"
    echo.
    echo.  
    echo.
    echo.                       
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #     Le dossier Baba est cr,e      #
    echo  #    #     #                                         #
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
    goto CreateShortcut
    goto pasdepass
     
    :ouvre
    cls
    attrib -h -s "%~dp0Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
    ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Baba
    Color 9A
    echo.
    echo. 
    echo.
    echo.                        
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #       Mot de passe est Correct !        #
    echo  #    #     #     Le dossier Baba est ouvert ! #                                   
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
     
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Start Explorer "%~dp0Baba"
    exit
    :Ping
    cls
    echo                     Mot de passe incorrect ? ? ?
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    goto SaisiePass
    :fin
    Timeout /NOBREAK /T 5 > Nul
    Exit /b
    :#Start
    <html>
    <head>
    <title>Mot de Passe © Hackoo</title>
    <hta:application id="htaid"
    applicationName="Password"
    border="thin"
    icon="wlrmdr.exe"
    borderStyle="normal"
    caption="yes"
    contextMenu="no"
    maximizeButton="no"
    minimizeButton="yes"
    navigable="yes"
    showInTaskbar="yes"
    singleInstance="yes"
    sysmenu="yes"
    SCROLL="NO" 
    SHOWINTASKBAR="Yes"   
    SELECTION="no"
    MINIMIZEBUTTON="no" 
    >
    </head>
    <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES"> 
    <BODY TOPMARGIN="1" LEFTMARGIN="1"><CENTER><DIV><SPAN ID="ONSCR"></SPAN></DIV></CENTER></BODY>
    <script language="vbscript">
    '---------------------------------------------------------------------------------------
    Sub Window_OnLoad
        CenterWindow 300,150
        Call PasswordForm()
        Call TextFocus()
    end sub
    '---------------------------------------------------------------------------------------
    Sub CenterWindow(x,y)
        Dim iLeft,itop
        window.resizeTo x,y
        iLeft = window.screen.availWidth/2 - x/2
        itop = window.screen.availHeight/2 - y/2
        window.moveTo ileft,itop
    End Sub
    '----------------------------------------------------------------------------------------
    Sub SavePassword()
        set fs=CreateObject("Scripting.FileSystemObject")
        strFile=fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2),"UserIn"))
        set ts=fs.OpenTextFile(strFile,2,True)
        If PasswordArea.value <> "" Then
            ts.WriteLine PasswordArea.value
            ts.Close
            self.Close 'Pour fermer ce HTA après avoir enregistré le mot de passe comme une variable dans le fichier Userin
        else
            Msgbox "Le mot de passe est vide ! "& Vbcrlf & "SVP entrez de nouveau votre mot de passe",VbExclamation,"Mot de Passe © Hackoo"
            Location.reload(true) 'Pour recharger à nouveau ce HTA
        end if
    End Sub
    '----------------------------------------------------------------------------------------
    Sub PasswordForm()
        Self.document.title = "Mot de Passe © Hackoo"
        Self.document.bgColor = "lightblue"
        ONSCR.InnerHTML="<center><FONT COLOR=""#FFFFFF"" SIZE=""+1"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Taper votre mot de passe</FONT<br>"_
        &"<input type=""password"" name=""PasswordArea"" size=""20"" onKeyUp=""TextFocus""><P>"_
        &"<input type=""Submit"" STYLE=""HEIGHT:25;WIDTH:110"" value=""OK"" onClick=""SavePassword"">"
    END Sub
    '----------------------------------------------------------------------------------------
    Sub TextFocus
        PasswordArea.Focus 
    End Sub
    '----------------------------------------------------------------------------------------
    </script>
    </body>
    </html>
    :#End
    ::***********************************************************************************************
    :CreateMyVBS
    ::'**********************************************************************************************
    (
    echo. Set fso = CreateObject^("Scripting.FileSystemObject"^)
    echo. Set f=fso.opentextfile^("%~f0",1^)
    echo. a=f.readall
    echo. Set r=new regexp
    echo. r.pattern = "(?:^|(?:\r\n))(?::#Start\r\n)([\s\S]*?)(?:\r\n)(?::#End)"
    echo. Set Matches = r.Execute^(a^)
    echo. If Matches.Count ^> 0 Then Data = Matches^(0^).SubMatches^(0^)
    echo. WriteFileText "%MyHTAFile%",Data
    echo. f.close
    ::'**********************************************************************************************
    echo. 
    echo. Function WriteFileText^(sFile,Data^)
    echo.     Dim objFSO,oTS,sText
    echo.     Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
    echo.     Set oTS = objFSO.CreateTextFile^(sFile,2^)
    echo.     oTS.WriteLine Data
    echo.     oTS.close
    echo.     set oTS = nothing
    echo.     Set objFSO = nothing
    echo. End Function 
    ) > %MyVBSFile%
    ::'***********************************************************************************************
    :CreateShortcut
    (
    echo Call Shortcut("%~f0","Private"^)
    echo ^'**********************************************************************************************^)
    echo Sub Shortcut(CheminApplication,Nom^)
    echo     Dim objShell,DesktopPath,objShortCut,MyTab
    echo     Set objShell = CreateObject("WScript.Shell"^)
    echo     MyTab = Split^(CheminApplication,"\"^)
    echo     If Nom = "" Then
    echo     Nom = MyTab(UBound^(MyTab^)^)
    echo     End if
    echo     DesktopPath = objShell.SpecialFolders("Desktop"^)
    echo     Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
    echo     objShortCut.TargetPath = Dblquote^(CheminApplication^)
    echo     objShortCut.WorkingDirectory = "%~dp0"
    echo     ObjShortCut.IconLocation = "wlrmdr.exe,0"
    echo     objShortCut.Save
    echo End Sub
    echo ^'**********************************************************************************************
    echo ^'Fonction pour ajouter les doubles quotes dans une variable
    echo Function DblQuote(Str^)
    echo     DblQuote = Chr(34^) ^& Str ^& Chr^(34^)
    echo End Function
    echo ^'**********************************************************************************************
    ) > C:\Protection\Shortcutme.vbs
    Start  C:\Protection\Shortcutme.vbs
    Timeout /NOBREAK /T 2 > Nul
    Del C:\Protection\Shortcutme.vbs
    ::******************************************************************************
    Bonne journée
    Seb



    ###############################
    C'est Totomatique, On va tout Totomate-isé ;-)
    ###############################

  6. #6
    Membre actif Avatar de GADENSEB
    Homme Profil pro
    Responsable Administratif et Financier
    Inscrit en
    Mars 2014
    Messages
    569
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Responsable Administratif et Financier
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2014
    Messages : 569
    Points : 285
    Points
    285
    Par défaut
    Hello le forum ..... pfff je trouve pas ....

    J'ai modifiré les adresses registres..... HKEY_CURRENT_USER\ pour que ce soit celles de Xp mais pas j'ai le mm message d'erreur .....qqn aurait une idée, je suis perdu !

    Bonne fin de dimanche


    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    @echo off
    Color 9B
    title Protection avec mot de passe ^| Version 1.5 by Hackoo
    mode con cols=67 lines=20
    Set MyVBSFile=C:\Protection\%~n0.vbs
    Set MyHTAFile=C:\Protection\%~n0.hta
    if EXIST "Control Panel.HKEY_CLASSES_ROOT\CLSID\{3FC0B520-68A9-11D0-8D77-00C04FD70822}" goto saisiePass
    if NOT EXIST BABA goto create
    reg query ""HKEY_CURRENT_USER\SOFTWARE\BABA"">Nul
    if %errorlevel%==1 goto pasdepass
     
    :confirm
    echo Voulez-vous verrouiller le dossier BABA ?( O/N )
    set /p "choix=>"
    if %choix%==O goto ferme
    if %choix%==o goto ferme
    if %choix%==n goto fin
    if %choix%==N goto fin
    echo Choix incorrect, veuillez répondre Oui ou Non.
    goto confirm
     
    :ferme
    cls
    Color 9A
    ren "%~dp0BABA" "Control Panel.HKEY_CLASSES_ROOT\CLSID\{3FC0B520-68A9-11D0-8D77-00C04FD70822}"
    attrib +h +s "Control Panel.HKEY_CLASSES_ROOT\CLSID\{3FC0B520-68A9-11D0-8D77-00C04FD70822}"
    echo.
    echo.
    echo.
    echo                             _####_
    echo                            #      #
    echo                           #        #
    echo                           #        #
    echo                           #        #
    echo                         ##############
    echo                        #              #
    echo                        #              #
    echo                        #      ##      #
    echo                        #     ####     #
    echo                        #     ####     #
    echo                        #      ##      #
    echo                        #      ##      #
    echo                        ################
    echo.
    echo.                  Dossier BABA verouillée
    echo. 
    echo. 
    goto fin
     
    :SaisiePass
    echo.
    echo         Veuillez saisir le mot de passe du Dossier BABA.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    Del "%MyVBSFile%" & Del "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "passout=%%i"
    echo.
    echo              V,rification du mot de passe en cours ....
    for /f "tokens=3" %%i in ('reg query ""HKEY_CURRENT_USER\SOFTWARE\BABA"" ^| find "MDP"') do set MDP=%%i
    Del C:\Protection\userIn
    if %passout%==%MDP% goto ouvre
    if NOT %passout%==%MDP% goto incorrect
    goto fin
     
    :pasdepass
    cls
    echo                Aucun mot de passe n'est défini.
    echo     Veuillez définir un mot de passe pour le dossier BABA.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    echo.
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (C:\Protection\userIn) do set "newpass1=%%i"
    echo        Veuillez confirmer de nouveau votre mot de passe
    Call :CreateMyVBS
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (C:\Protection\userIn) do set "newpass2=%%i"
     
    if "%newpass1%"=="%newpass2%" goto AjoutPassReg
    if Not "%newpass1%"=="%newpass2%" echo Les Deux mots de passes ne sont pas identiques ? 
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Del "%MyVBSFile%" & Del "%MyHTAFile%" & Del C:\Protection\userIn
    goto pasdepass
    goto fin
    :AjoutPassReg
    reg Add ""HKEY_CURRENT_USER\SOFTWARE\BABA"" /v MDP /t REG_SZ /d %newpass2% > NUL
    goto ferme
    goto fin 
    :incorrect
    cls
    Color BC & echo.
    echo                  Mot de passe incorrect ? ? ?
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Goto ping
     
    :create
    md "%~dp0BABA"
    echo.
    echo.  
    echo.
    echo.                       
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #     Le dossier BABA est cr,e      #
    echo  #    #     #                                         #
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
    goto CreateShortcut
    goto pasdepass
     
    :ouvre
    cls
    attrib -h -s "%~dp0Control Panel.HKEY_CLASSES_ROOT\CLSID\{3FC0B520-68A9-11D0-8D77-00C04FD70822}"
    ren "Control Panel.HKEY_CLASSES_ROOT\CLSID\{3FC0B520-68A9-11D0-8D77-00C04FD70822}" BABA
    Color 9A
    echo.
    echo. 
    echo.
    echo.                        
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #       Mot de passe est Correct !        #
    echo  #    #     #     Le dossier BABA est ouvert ! #                                   
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
     
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Start Explorer "%~dp0BABA"
    exit
    :Ping
    cls
    echo                     Mot de passe incorrect ? ? ?
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    goto SaisiePass
    :fin
    Timeout /NOBREAK /T 5 > Nul
    Exit /b
    :#Start
    <html>
    <head>
    <title>Mot de Passe © Hackoo</title>
    <hta:application id="htaid"
    applicationName="Password"
    border="thin"
    icon="wlrmdr.exe"
    borderStyle="normal"
    caption="yes"
    contextMenu="no"
    maximizeButton="no"
    minimizeButton="yes"
    navigable="yes"
    showInTaskbar="yes"
    singleInstance="yes"
    sysmenu="yes"
    SCROLL="NO" 
    SHOWINTASKBAR="Yes"   
    SELECTION="no"
    MINIMIZEBUTTON="no" 
    >
    </head>
    <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES"> 
    <BODY TOPMARGIN="1" LEFTMARGIN="1"><CENTER><DIV><SPAN ID="ONSCR"></SPAN></DIV></CENTER></BODY>
    <script language="vbscript">
    '---------------------------------------------------------------------------------------
    Sub Window_OnLoad
        CenterWindow 300,150
        Call PasswordForm()
        Call TextFocus()
    end sub
    '---------------------------------------------------------------------------------------
    Sub CenterWindow(x,y)
        Dim iLeft,itop
        window.resizeTo x,y
        iLeft = window.screen.availWidth/2 - x/2
        itop = window.screen.availHeight/2 - y/2
        window.moveTo ileft,itop
    End Sub
    '----------------------------------------------------------------------------------------
    Sub SavePassword()
        set fs=CreateObject("Scripting.FileSystemObject")
        strFile=fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2),"UserIn"))
        set ts=fs.OpenTextFile(strFile,2,True)
        If PasswordArea.value <> "" Then
            ts.WriteLine PasswordArea.value
            ts.Close
            self.Close 'Pour fermer ce HTA après avoir enregistré le mot de passe comme une variable dans le fichier Userin
        else
            Msgbox "Le mot de passe est vide ! "& Vbcrlf & "SVP entrez de nouveau votre mot de passe",VbExclamation,"Mot de Passe © Hackoo"
            Location.reload(true) 'Pour recharger à nouveau ce HTA
        end if
    End Sub
    '----------------------------------------------------------------------------------------
    Sub PasswordForm()
        Self.document.title = "Mot de Passe © Hackoo"
        Self.document.bgColor = "lightblue"
        ONSCR.InnerHTML="<center><FONT COLOR=""#FFFFFF"" SIZE=""+1"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Taper votre mot de passe</FONT<br>"_
        &"<input type=""password"" name=""PasswordArea"" size=""20"" onKeyUp=""TextFocus""><P>"_
        &"<input type=""Submit"" STYLE=""HEIGHT:25;WIDTH:110"" value=""OK"" onClick=""SavePassword"">"
    END Sub
    '----------------------------------------------------------------------------------------
    Sub TextFocus
        PasswordArea.Focus 
    End Sub
    '----------------------------------------------------------------------------------------
    </script>
    </body>
    </html>
    :#End
    ::***********************************************************************************************
    :CreateMyVBS
    ::'**********************************************************************************************
    (
    echo. Set fso = CreateObject^("Scripting.FileSystemObject"^)
    echo. Set f=fso.opentextfile^("%~f0",1^)
    echo. a=f.readall
    echo. Set r=new regexp
    echo. r.pattern = "(?:^|(?:\r\n))(?::#Start\r\n)([\s\S]*?)(?:\r\n)(?::#End)"
    echo. Set Matches = r.Execute^(a^)
    echo. If Matches.Count ^> 0 Then Data = Matches^(0^).SubMatches^(0^)
    echo. WriteFileText "%MyHTAFile%",Data
    echo. f.close
    ::'**********************************************************************************************
    echo. 
    echo. Function WriteFileText^(sFile,Data^)
    echo.     Dim objFSO,oTS,sText
    echo.     Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
    echo.     Set oTS = objFSO.CreateTextFile^(sFile,2^)
    echo.     oTS.WriteLine Data
    echo.     oTS.close
    echo.     set oTS = nothing
    echo.     Set objFSO = nothing
    echo. End Function 
    ) > %MyVBSFile%
    ::'***********************************************************************************************
    :CreateShortcut
    (
    echo Call Shortcut("%~f0","Private"^)
    echo ^'**********************************************************************************************^)
    echo Sub Shortcut(CheminApplication,Nom^)
    echo     Dim objShell,DesktopPath,objShortCut,MyTab
    echo     Set objShell = CreateObject("WScript.Shell"^)
    echo     MyTab = Split^(CheminApplication,"\"^)
    echo     If Nom = "" Then
    echo     Nom = MyTab(UBound^(MyTab^)^)
    echo     End if
    echo     DesktopPath = objShell.SpecialFolders("Desktop"^)
    echo     Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
    echo     objShortCut.TargetPath = Dblquote^(CheminApplication^)
    echo     objShortCut.WorkingDirectory = "%~dp0"
    echo     ObjShortCut.IconLocation = "wlrmdr.exe,0"
    echo     objShortCut.Save
    echo End Sub
    echo ^'**********************************************************************************************
    echo ^'Fonction pour ajouter les doubles quotes dans une variable
    echo Function DblQuote(Str^)
    echo     DblQuote = Chr(34^) ^& Str ^& Chr^(34^)
    echo End Function
    echo ^'**********************************************************************************************
    ) > C:\Protection\Shortcutme.vbs
    Start  C:\Protection\Shortcutme.vbs
    Timeout /NOBREAK /T 2 > Nul
    Del C:\Protection\Shortcutme.vbs
    ::******************************************************************************
    Bonne journée
    Seb



    ###############################
    C'est Totomatique, On va tout Totomate-isé ;-)
    ###############################

  7. #7
    Membre actif Avatar de GADENSEB
    Homme Profil pro
    Responsable Administratif et Financier
    Inscrit en
    Mars 2014
    Messages
    569
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Activité : Responsable Administratif et Financier
    Secteur : Finance

    Informations forums :
    Inscription : Mars 2014
    Messages : 569
    Points : 285
    Points
    285
    Par défaut
    Re ..... j'y suis presque

    J'ai retrouvé la version 1.4 du coffre fort d'Hackoo qui me crée le dossier sans soucis

    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    @echo off
    Color 9B
    title Coffre avec mot de passe ^| Version 1.4 Updated by Hackoo
    mode con cols=60 lines=20
    if EXIST "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}" goto saisiePass
    if NOT EXIST Coffre goto create
    reg query ""HKLM\SOFTWARE\Coffre"">Nul
    if %errorlevel%==1 goto pasdepass
     
    :confirm
    echo Voulez-vous verrouiller le dossier Coffre?(O/N)
    set /p "choix=>"
    if %choix%==O goto ferme
    if %choix%==o goto ferme
    if %choix%==n goto fin
    if %choix%==N goto fin
    echo Choix incorrect, veuillez r‚pondre Oui ou Non.
    goto confirm
     
    :ferme
    cls
    Color 9A
    ren Coffre "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    attrib +h +s "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    echo Dossier Coffre verouill‚.
    goto fin
     
    :SaisiePass
    echo Entrez le mot de passe du Dossier Coffre.
    set /p "passout=>"
    echo V‚rification du mot de passe en cours ....
    for /f "tokens=3" %%i in ('reg query ""HKLM\SOFTWARE\Coffre"" ^| find "MDP"') do set MDP=%%i
    if %passout%==%MDP% goto ouvre
    if NOT %passout%==%MDP% goto incorrect
    goto fin
     
    :pasdepass
    cls
    echo Aucun mot de passe n'est d‚fini.
    echo Veuillez d‚finir un mot de passe pour le dossier Coffre.
    set /p "newpass1=>"
    echo Veuillez confirmer de nouveau votre mot de passe
    set /p "newpass2=>"
    if "%newpass1%"=="%newpass2%" goto AjoutPassReg
    if Not "%newpass1%"=="%newpass2%" echo Les Deux mots de passes ne sont pas identiques ? 
    PING 1.1.1.1 -n 1 -w 5000 >NUL
    goto pasdepass
    goto fin
    :AjoutPassReg
    reg Add ""HKLM\SOFTWARE\Coffre"" /v MDP /t REG_SZ /d %newpass2% > NUL
    goto ferme
    goto fin
     
    :incorrect
    cls
    Color BC & echo Mot de passe incorrect ? ? ?
    Goto Ping
     
    :create
    md Coffre
    echo Le dossier Coffre est cr‚‚.
    goto pasdepass
     
    :ouvre
    cls
    attrib -h -s "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    ren "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}" Coffre
    Color 9A
    echo Mot de passe est Correct !
    echo Le dossier Coffre est ouvert.
    PING 1.1.1.1 -n 1 -w 5000 >NUL
    Start Explorer c:\coffre
    exit
    :Ping
    PING 1.1.1.1 -n 1 -w 5000 >NUL
    goto SaisiePass
    :fin
    pause

    Du coup, je transforme le code à ces niveaux là
    Control Panel.{2227A280-3AEA-1069-A2DE-08002B3309D} et HKLM\SOFTWARE dans mon code


    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    @echo off
    Color 9B
    title Protection avec mot de passe ^| Version 1.5 by Hackoo
    mode con cols=67 lines=20
    Set MyVBSFile=C:\Protection\%~n0.vbs
    Set MyHTAFile=C:\Protection\%~n0.hta
    if EXIST "Control Panel.HKEY_CLASSES_ROOT\CLSID\{2227A280-3AEA-1069-A2DE-08002B30309D}" goto saisiePass
    if NOT EXIST BABA goto create
    reg query ""HKLM\SOFTWARE\BABA"">Nul
    if %errorlevel%==1 goto pasdepass
     
    :confirm
    echo Voulez-vous verrouiller le dossier BABA ?( O/N )
    set /p "choix=>"
    if %choix%==O goto ferme
    if %choix%==o goto ferme
    if %choix%==n goto fin
    if %choix%==N goto fin
    echo Choix incorrect, veuillez répondre Oui ou Non.
    goto confirm
     
    :ferme
    cls
    Color 9A
    ren "%~dp0BABA" "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    attrib +h +s "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}"
    echo.
    echo.
    echo.
    echo                             _####_
    echo                            #      #
    echo                           #        #
    echo                           #        #
    echo                           #        #
    echo                         ##############
    echo                        #              #
    echo                        #              #
    echo                        #      ##      #
    echo                        #     ####     #
    echo                        #     ####     #
    echo                        #      ##      #
    echo                        #      ##      #
    echo                        ################
    echo.
    echo.                  Dossier BABA verouillée
    echo. 
    echo. 
    goto fin
     
    :SaisiePass
    echo.
    echo         Veuillez saisir le mot de passe du Dossier BABA.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    Del "%MyVBSFile%" & Del "%MyHTAFile%"
    for /f %%i in (%tmp%\userIn) do set "passout=%%i"
    echo.
    echo              V,rification du mot de passe en cours ....
    for /f "tokens=3" %%i in ('reg query ""HKLM\SOFTWARE\BABA"" ^| find "MDP"') do set MDP=%%i
    Del C:\Protection\userIn
    if %passout%==%MDP% goto ouvre
    if NOT %passout%==%MDP% goto incorrect
    goto fin
     
    :pasdepass
    cls
    echo                Aucun mot de passe n'est défini.
    echo     Veuillez définir un mot de passe pour le dossier BABA.
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    echo.
    Call :CreateMyVBS
    Cscript.exe //NOLOGO %MyVBSFile%
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (C:\Protection\userIn) do set "newpass1=%%i"
    echo        Veuillez confirmer de nouveau votre mot de passe
    Call :CreateMyVBS
    start /wait mshta.exe "%MyHTAFile%"
    for /f %%i in (C:\Protection\userIn) do set "newpass2=%%i"
     
    if "%newpass1%"=="%newpass2%" goto AjoutPassReg
    if Not "%newpass1%"=="%newpass2%" echo Les Deux mots de passes ne sont pas identiques ? 
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Del "%MyVBSFile%" & Del "%MyHTAFile%" & Del C:\Protection\userIn
    goto pasdepass
    goto fin
    :AjoutPassReg
    reg Add ""HKLM\SOFTWARE\BABA"" /v MDP /t REG_SZ /d %newpass2% > NUL
    goto ferme
    goto fin 
    :incorrect
    cls
    Color BC & echo.
    echo                  Mot de passe incorrect ? ? ?
    echo.
    echo.                                   
    echo                               ####
    echo                               ###
    echo                               ####
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                               ##
    echo                             ##  ##
    echo                            ##    ##
    echo                            ##    ##
    echo                             ##__##
    echo                               ##    
    Goto ping
     
    :create
    md "%~dp0BABA"
    echo.
    echo.  
    echo.
    echo.                       
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #     Le dossier BABA est cr,e      #
    echo  #    #     #                                         #
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
    goto CreateShortcut
    goto pasdepass
     
    :ouvre
    cls
    attrib -h -s "%~dp0Control Panel.\{2227A280-3AEA-1069-A2DE-08002B30309D}"
    ren "Control Panel.{2227A280-3AEA-1069-A2DE-08002B30309D}" BABA
    Color 9A
    echo.
    echo. 
    echo.
    echo.                        
    echo               #######################################
    echo          #   #                                       #
    echo         #   #                                         #
    echo        #    #       Mot de passe est Correct !        #
    echo  #    #     #     Le dossier BABA est ouvert ! #                                   
    echo   #  #       #                                       #
    echo    ##         #######################################
    echo.
    echo.
     
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    Start Explorer "%~dp0BABA"
    exit
    :Ping
    cls
    echo                     Mot de passe incorrect ? ? ?
    PING 1.1.1.1 -n 1 -w 1000 >NUL
    goto SaisiePass
    :fin
    Timeout /NOBREAK /T 5 > Nul
    Exit /b
    :#Start
    <html>
    <head>
    <title>Mot de Passe © Hackoo</title>
    <hta:application id="htaid"
    applicationName="Password"
    border="thin"
    icon="wlrmdr.exe"
    borderStyle="normal"
    caption="yes"
    contextMenu="no"
    maximizeButton="no"
    minimizeButton="yes"
    navigable="yes"
    showInTaskbar="yes"
    singleInstance="yes"
    sysmenu="yes"
    SCROLL="NO" 
    SHOWINTASKBAR="Yes"   
    SELECTION="no"
    MINIMIZEBUTTON="no" 
    >
    </head>
    <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES"> 
    <BODY TOPMARGIN="1" LEFTMARGIN="1"><CENTER><DIV><SPAN ID="ONSCR"></SPAN></DIV></CENTER></BODY>
    <script language="vbscript">
    '---------------------------------------------------------------------------------------
    Sub Window_OnLoad
        CenterWindow 300,150
        Call PasswordForm()
        Call TextFocus()
    end sub
    '---------------------------------------------------------------------------------------
    Sub CenterWindow(x,y)
        Dim iLeft,itop
        window.resizeTo x,y
        iLeft = window.screen.availWidth/2 - x/2
        itop = window.screen.availHeight/2 - y/2
        window.moveTo ileft,itop
    End Sub
    '----------------------------------------------------------------------------------------
    Sub SavePassword()
        set fs=CreateObject("Scripting.FileSystemObject")
        strFile=fs.GetAbsolutePathName(fs.BuildPath(fs.GetSpecialFolder(2),"UserIn"))
        set ts=fs.OpenTextFile(strFile,2,True)
        If PasswordArea.value <> "" Then
            ts.WriteLine PasswordArea.value
            ts.Close
            self.Close 'Pour fermer ce HTA après avoir enregistré le mot de passe comme une variable dans le fichier Userin
        else
            Msgbox "Le mot de passe est vide ! "& Vbcrlf & "SVP entrez de nouveau votre mot de passe",VbExclamation,"Mot de Passe © Hackoo"
            Location.reload(true) 'Pour recharger à nouveau ce HTA
        end if
    End Sub
    '----------------------------------------------------------------------------------------
    Sub PasswordForm()
        Self.document.title = "Mot de Passe © Hackoo"
        Self.document.bgColor = "lightblue"
        ONSCR.InnerHTML="<center><FONT COLOR=""#FFFFFF"" SIZE=""+1"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Taper votre mot de passe</FONT<br>"_
        &"<input type=""password"" name=""PasswordArea"" size=""20"" onKeyUp=""TextFocus""><P>"_
        &"<input type=""Submit"" STYLE=""HEIGHT:25;WIDTH:110"" value=""OK"" onClick=""SavePassword"">"
    END Sub
    '----------------------------------------------------------------------------------------
    Sub TextFocus
        PasswordArea.Focus 
    End Sub
    '----------------------------------------------------------------------------------------
    </script>
    </body>
    </html>
    :#End
    ::***********************************************************************************************
    :CreateMyVBS
    ::'**********************************************************************************************
    (
    echo. Set fso = CreateObject^("Scripting.FileSystemObject"^)
    echo. Set f=fso.opentextfile^("%~f0",1^)
    echo. a=f.readall
    echo. Set r=new regexp
    echo. r.pattern = "(?:^|(?:\r\n))(?::#Start\r\n)([\s\S]*?)(?:\r\n)(?::#End)"
    echo. Set Matches = r.Execute^(a^)
    echo. If Matches.Count ^> 0 Then Data = Matches^(0^).SubMatches^(0^)
    echo. WriteFileText "%MyHTAFile%",Data
    echo. f.close
    ::'**********************************************************************************************
    echo. 
    echo. Function WriteFileText^(sFile,Data^)
    echo.     Dim objFSO,oTS,sText
    echo.     Set objFSO = CreateObject^("Scripting.FileSystemObject"^)
    echo.     Set oTS = objFSO.CreateTextFile^(sFile,2^)
    echo.     oTS.WriteLine Data
    echo.     oTS.close
    echo.     set oTS = nothing
    echo.     Set objFSO = nothing
    echo. End Function 
    ) > %MyVBSFile%
    ::'***********************************************************************************************
    :CreateShortcut
    (
    echo Call Shortcut("%~f0","Private"^)
    echo ^'**********************************************************************************************^)
    echo Sub Shortcut(CheminApplication,Nom^)
    echo     Dim objShell,DesktopPath,objShortCut,MyTab
    echo     Set objShell = CreateObject("WScript.Shell"^)
    echo     MyTab = Split^(CheminApplication,"\"^)
    echo     If Nom = "" Then
    echo     Nom = MyTab(UBound^(MyTab^)^)
    echo     End if
    echo     DesktopPath = objShell.SpecialFolders("Desktop"^)
    echo     Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
    echo     objShortCut.TargetPath = Dblquote^(CheminApplication^)
    echo     objShortCut.WorkingDirectory = "%~dp0"
    echo     ObjShortCut.IconLocation = "wlrmdr.exe,0"
    echo     objShortCut.Save
    echo End Sub
    echo ^'**********************************************************************************************
    echo ^'Fonction pour ajouter les doubles quotes dans une variable
    echo Function DblQuote(Str^)
    echo     DblQuote = Chr(34^) ^& Str ^& Chr^(34^)
    echo End Function
    echo ^'**********************************************************************************************
    ) > C:\Protection\Shortcutme.vbs
    Start  C:\Protection\Shortcutme.vbs
    Timeout /NOBREAK /T 2 > Nul
    Del C:\Protection\Shortcutme.vbs
    ::******************************************************************************


    le dossier est crée et J'obtiens tjrs le message --->le raccourcis sur le fond d'écran ne se crée pas

    Nom : Nouvelle image.JPG
Affichages : 161
Taille : 12,0 Ko

    Donc le soucis est par là

    Code bat : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    echo Call Shortcut("%~f0","Private"^)
    echo ^'**********************************************************************************************^)
    echo Sub Shortcut(CheminApplication,Nom^)
    echo     Dim objShell,DesktopPath,objShortCut,MyTab
    echo     Set objShell = CreateObject("WScript.Shell"^)
    echo     MyTab = Split^(CheminApplication,"\"^)
    echo     If Nom = "" Then
    echo     Nom = MyTab(UBound^(MyTab^)^)
    echo     End if
    echo     DesktopPath = objShell.SpecialFolders("Desktop"^)
    echo     Set objShortCut = objShell.CreateShortcut(DesktopPath ^& "\" ^& Nom ^& ".lnk"^)
    echo     objShortCut.TargetPath = Dblquote^(CheminApplication^)
    echo     objShortCut.WorkingDirectory = "%~dp0"
    echo     ObjShortCut.IconLocation = "wlrmdr.exe,0"
    echo     objShortCut.Save
    echo End Sub
    echo ^'**********************************************************************************************
    echo ^'Fonction pour ajouter les doubles quotes dans une variable
    echo Function DblQuote(Str^)
    echo     DblQuote = Chr(34^) ^& Str ^& Chr^(34^)
    echo End Function
    echo ^'**********************************************************************************************
    ) > C:\Protection\Shortcutme.vbs
    Start  C:\Protection\Shortcutme.vbs
    Timeout /NOBREAK /T 2 > Nul
    Del C:\Protection\Shortcutme.vbs

    Pas d'idée pour l'instant...

    Bonne soirée
    Bonne journée
    Seb



    ###############################
    C'est Totomatique, On va tout Totomate-isé ;-)
    ###############################

Discussions similaires

  1. [Batch] Protéger dossier / Win 7 / avec raccourci sur le fond d'écran
    Par GADENSEB dans le forum Scripts/Batch
    Réponses: 24
    Dernier message: 28/08/2015, 22h50
  2. [OL-2010] Déplacer un courriel dans un dossier mis en raccourci sur un bureau
    Par marycaLou dans le forum VBA Outlook
    Réponses: 11
    Dernier message: 14/04/2014, 15h59
  3. Réponses: 3
    Dernier message: 02/08/2011, 16h05
  4. Dossiers metamophosés en raccourcis sur mon DD externe
    Par tarbala dans le forum Sécurité
    Réponses: 1
    Dernier message: 18/05/2011, 23h02

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo