Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. getting input from an output in batch

getting input from an output in batch

Scheduled Pinned Locked Moved System Admin
tutorialtoolshelp
6 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kmkmahesh
    wrote on last edited by
    #1

    i want some help from u people that i am buiding a batch script to lock files and making them undeletable with md5 password protecting but i want an example how to give the output of a command as input of a variable exactly for md5 it will asks for password and it has to write the hashes in another batch script so i am asking u people to help me in 1 or two days i will post the code here

    D 1 Reply Last reply
    0
    • K kmkmahesh

      i want some help from u people that i am buiding a batch script to lock files and making them undeletable with md5 password protecting but i want an example how to give the output of a command as input of a variable exactly for md5 it will asks for password and it has to write the hashes in another batch script so i am asking u people to help me in 1 or two days i will post the code here

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      kmkmahesh wrote:

      i am buiding a batch script to lock files and making them undeletable with md5 password protecting

      Yeah, right. You're not going to do this with just a batch file. You have to have some external utilities to do this. Oh, and if your trying to use that little trick where you change the folder/file name to a GUID, forget it. It's easily defeatable.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      K 1 Reply Last reply
      0
      • D Dave Kreskowiak

        kmkmahesh wrote:

        i am buiding a batch script to lock files and making them undeletable with md5 password protecting

        Yeah, right. You're not going to do this with just a batch file. You have to have some external utilities to do this. Oh, and if your trying to use that little trick where you change the folder/file name to a GUID, forget it. It's easily defeatable.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        K Offline
        K Offline
        kmkmahesh
        wrote on last edited by
        #3

        i got some solution for my question but one more problem occurs this code replaces the text in a file but i have problem with this code

        :: Create the assembler program, by Herbert Kleebauer
        echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=> %temp%.\sbs2.com
        echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>> %temp%.\sbs2.com
        echo ?@}IKuNWpe~Fpe?FNHlF?wGMECIQqo{Ox{T?kPv@jeoSeIlRFD@{AyEKj@>> %temp%.\sbs2.com
        echo iqe~1NeAyR?mHAG~BGRgB{~H?o~TsdgCYqe?HR~upkpBG?~slJBCyA?@xA>> %temp%.\sbs2.com
        echo LZp{xq`Cs?H[C_vHDyB?Hos@QslFA@wQ~~x}viH}`LYNBGyA?@xAB?sUq`>> %temp%.\sbs2.com
        echo LRy@PwtCYQEuFK@A~BxPtDss@fFqjVmzD@qBEOEenU?`eHHeBCMs?FExep>> %temp%.\sbs2.com
        echo LHsPBGyA?@xAunjzA}EKNs@CA?wQpQpKLBHv?s`WJ`LRCYyIWMJaejCksl>> %temp%.\sbs2.com
        echo H[GyFGhHBwHZjjHeoFasuFUJeHeB?OsQH[xeHCPvqFj@oq@eNc?~}Nu??O>> %temp%.\sbs2.com
        echo ~oEwoAjBKs?Zp`LBzHQzyEFrAWAG{EFrAqAGYwHTECIQ{coKIsaCsf{Oe~>> %temp%.\sbs2.com
        echo CK}Ayre~CNFA{rAyEKFACrA{EKGAjbA}eKGSjNMtQFtc{OAyDGFj?{FDGQ>> %temp%.\sbs2.com
        echo KAjNVk_OCAx@e?f{o?CosI}1EGizhljJ~H1ZeG}JBA~rACBMDGjjDG@g0>> %temp%.\sbs2.com

        :: Use the program
        %temp%.\sbs2.com 0 "&" "&" < c:\dirlist.xml > c:\dirlist1.xml

        more details available of this code is HERE AND I just want to

        %temp%.\sbs2.com 0 "&" "&" < c:\dirlist.xml >

        i want to assign a variable in that with %variablename% so please help for me

        D 1 Reply Last reply
        0
        • K kmkmahesh

          i got some solution for my question but one more problem occurs this code replaces the text in a file but i have problem with this code

          :: Create the assembler program, by Herbert Kleebauer
          echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=> %temp%.\sbs2.com
          echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU!WvX0GwUY Wv;ovBX2Gv0ExGIuht6>> %temp%.\sbs2.com
          echo ?@}IKuNWpe~Fpe?FNHlF?wGMECIQqo{Ox{T?kPv@jeoSeIlRFD@{AyEKj@>> %temp%.\sbs2.com
          echo iqe~1NeAyR?mHAG~BGRgB{~H?o~TsdgCYqe?HR~upkpBG?~slJBCyA?@xA>> %temp%.\sbs2.com
          echo LZp{xq`Cs?H[C_vHDyB?Hos@QslFA@wQ~~x}viH}`LYNBGyA?@xAB?sUq`>> %temp%.\sbs2.com
          echo LRy@PwtCYQEuFK@A~BxPtDss@fFqjVmzD@qBEOEenU?`eHHeBCMs?FExep>> %temp%.\sbs2.com
          echo LHsPBGyA?@xAunjzA}EKNs@CA?wQpQpKLBHv?s`WJ`LRCYyIWMJaejCksl>> %temp%.\sbs2.com
          echo H[GyFGhHBwHZjjHeoFasuFUJeHeB?OsQH[xeHCPvqFj@oq@eNc?~}Nu??O>> %temp%.\sbs2.com
          echo ~oEwoAjBKs?Zp`LBzHQzyEFrAWAG{EFrAqAGYwHTECIQ{coKIsaCsf{Oe~>> %temp%.\sbs2.com
          echo CK}Ayre~CNFA{rAyEKFACrA{EKGAjbA}eKGSjNMtQFtc{OAyDGFj?{FDGQ>> %temp%.\sbs2.com
          echo KAjNVk_OCAx@e?f{o?CosI}1EGizhljJ~H1ZeG}JBA~rACBMDGjjDG@g0>> %temp%.\sbs2.com

          :: Use the program
          %temp%.\sbs2.com 0 "&" "&" < c:\dirlist.xml > c:\dirlist1.xml

          more details available of this code is HERE AND I just want to

          %temp%.\sbs2.com 0 "&" "&" < c:\dirlist.xml >

          i want to assign a variable in that with %variablename% so please help for me

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          What variable name?? The only one there returns the path to the users local Temp folder. This just creates an old DOS .COM file that gets executed. The SBS2 utiluty just does a search and replace of a string in another file. It offers no password functionality what-so-ever.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008
          But no longer in 2009...

          K 1 Reply Last reply
          0
          • D Dave Kreskowiak

            What variable name?? The only one there returns the path to the users local Temp folder. This just creates an old DOS .COM file that gets executed. The SBS2 utiluty just does a search and replace of a string in another file. It offers no password functionality what-so-ever.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            K Offline
            K Offline
            kmkmahesh
            wrote on last edited by
            #5

            bro i am building a batch file to lock the folders with a password without any software using only md5.exe code is below

            title MAKING OF FOLDER LOCKER BATCH SCRIPT WITH BATCH
            @ECHO OFF
            SET NEW=%USERPROFILE%\DESKTOP\
            if not exist md5.exe goto md5error
            copy md5.exe %windir%\system32\

            ::creating batchfile of md5locker.cmd
            echo echo cls=>%temp%.\md5locker.cmd
            echo echo "Enter the Path of the drive">>%temp%.\md5locker.cmd
            echo set/p "dpat=>">>%temp%.\md5locker.cmd
            echo %dpat%>>%temp%.\md5locker.cmd
            echo if %dpat%==c: goto CNG>>%temp%.\md5locker.cmd
            echo if NOT %dpat%==c: goto FPAT>>%temp%.\md5locker.cmd
            echo :CNG>>%temp%.\md5locker.cmd
            echo cd\>>%temp%.\md5locker.cmd
            echo goto FPAT>>%temp%.\md5locker.cmd
            echo :FPAT>>%temp%.\md5locker.cmd
            echo cls>>%temp%.\md5locker.cmd
            echo echo "Enter the Path of the folder without drive name">>%temp%.\md5locker.cmd
            echo set/p "fpat=>">>%temp%.\md5locker.cmd
            echo cd %fpat%>>%temp%.\md5locker.cmd
            echo if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK>>%temp%.\md5locker.cmd
            echo echo "NO Locked Folders exist Please Enter the Name of the folder to Lock">>%temp%.\md5locker.cmd
            echo set/p "name=>">>%temp%.\md5locker.cmd
            echo if EXIST %name% goto LOCK>>%temp%.\md5locker.cmd
            echo if NOT EXIST %name% goto MD>>%temp%.\md5locker.cmd
            echo :MD >>%temp%.\md5locker.cmd
            echo echo. Are you sure to Create and Lock the folder %name%(Y/N)>>%temp%.\md5locker.cmd
            echo set/p "ch=>">>%temp%.\md5locker.cmd
            echo if %ch%==Y goto MDLOCKER>>%temp%.\md5locker.cmd
            echo if %ch%==y goto MDLOCKER>>%temp%.\md5locker.cmd
            echo if %ch%==n goto END>>%temp%.\md5locker.cmd
            echo if %ch%==N goto END>>%temp%.\md5locker.cmd
            echo echo Invalid choice.>>%temp%.\md5locker.cmd
            echo goto MD>>%temp%.\md5locker.cmd
            echo :CONFIRM>>%temp%.\md5locker.cmd
            echo echo Are you sure u want to Lock the folder(Y/N)>>%temp%.\md5locker.cmd
            echo set/p "cho=>">>%temp%.\md5locker.cmd
            echo if %cho%==Y goto LOCK>>%temp%.\md5locker.cmd
            echo if %cho%==y goto LOCK>>%temp%.\md5locker.cmd
            echo if %cho%==n goto END>>%temp%.\md5locker.cmd
            echo if %cho%==N goto END>>%temp%.\md5locker.cmd
            echo echo Invalid choice.>>%temp%.\md5locker.cmd
            echo goto CONFIRM>>%temp%.\md5locker.cmd
            echo :LOCK>>%temp%.\md5locker.cmd
            echo ren %name% "Control Panel.{21EC

            D 1 Reply Last reply
            0
            • K kmkmahesh

              bro i am building a batch file to lock the folders with a password without any software using only md5.exe code is below

              title MAKING OF FOLDER LOCKER BATCH SCRIPT WITH BATCH
              @ECHO OFF
              SET NEW=%USERPROFILE%\DESKTOP\
              if not exist md5.exe goto md5error
              copy md5.exe %windir%\system32\

              ::creating batchfile of md5locker.cmd
              echo echo cls=>%temp%.\md5locker.cmd
              echo echo "Enter the Path of the drive">>%temp%.\md5locker.cmd
              echo set/p "dpat=>">>%temp%.\md5locker.cmd
              echo %dpat%>>%temp%.\md5locker.cmd
              echo if %dpat%==c: goto CNG>>%temp%.\md5locker.cmd
              echo if NOT %dpat%==c: goto FPAT>>%temp%.\md5locker.cmd
              echo :CNG>>%temp%.\md5locker.cmd
              echo cd\>>%temp%.\md5locker.cmd
              echo goto FPAT>>%temp%.\md5locker.cmd
              echo :FPAT>>%temp%.\md5locker.cmd
              echo cls>>%temp%.\md5locker.cmd
              echo echo "Enter the Path of the folder without drive name">>%temp%.\md5locker.cmd
              echo set/p "fpat=>">>%temp%.\md5locker.cmd
              echo cd %fpat%>>%temp%.\md5locker.cmd
              echo if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK>>%temp%.\md5locker.cmd
              echo echo "NO Locked Folders exist Please Enter the Name of the folder to Lock">>%temp%.\md5locker.cmd
              echo set/p "name=>">>%temp%.\md5locker.cmd
              echo if EXIST %name% goto LOCK>>%temp%.\md5locker.cmd
              echo if NOT EXIST %name% goto MD>>%temp%.\md5locker.cmd
              echo :MD >>%temp%.\md5locker.cmd
              echo echo. Are you sure to Create and Lock the folder %name%(Y/N)>>%temp%.\md5locker.cmd
              echo set/p "ch=>">>%temp%.\md5locker.cmd
              echo if %ch%==Y goto MDLOCKER>>%temp%.\md5locker.cmd
              echo if %ch%==y goto MDLOCKER>>%temp%.\md5locker.cmd
              echo if %ch%==n goto END>>%temp%.\md5locker.cmd
              echo if %ch%==N goto END>>%temp%.\md5locker.cmd
              echo echo Invalid choice.>>%temp%.\md5locker.cmd
              echo goto MD>>%temp%.\md5locker.cmd
              echo :CONFIRM>>%temp%.\md5locker.cmd
              echo echo Are you sure u want to Lock the folder(Y/N)>>%temp%.\md5locker.cmd
              echo set/p "cho=>">>%temp%.\md5locker.cmd
              echo if %cho%==Y goto LOCK>>%temp%.\md5locker.cmd
              echo if %cho%==y goto LOCK>>%temp%.\md5locker.cmd
              echo if %cho%==n goto END>>%temp%.\md5locker.cmd
              echo if %cho%==N goto END>>%temp%.\md5locker.cmd
              echo echo Invalid choice.>>%temp%.\md5locker.cmd
              echo goto CONFIRM>>%temp%.\md5locker.cmd
              echo :LOCK>>%temp%.\md5locker.cmd
              echo ren %name% "Control Panel.{21EC

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Yep, I knew it. You're using the "GUID Trick" to "lock" folders. I'm sorry to say that this little trick is easily defeatable. As impressive as your batch file is, you're also wasting your time. I'll give you a hint. The folder isn't really "locked" to everything, only to Explorer.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups