Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch file to unblock files copied from internet  (Read 5425 times)

0 Members and 1 Guest are viewing this topic.

karlosss

    Topic Starter


    Beginner

    • Experience: Beginner
    • OS: Windows XP
    Batch file to unblock files copied from internet
    « on: November 12, 2017, 06:10:16 AM »
    Batch file to unblock files copied from internet?i found this: https://stackoverflow.com/questions/15263523/batch-file-to-unblock-files-copied-from-internet

    and i use this  and reaally works: FOR %a in (*.dll *.exe *.bat *.txt *.md) do (echo.>%a:Zone.Identifier)

    The problem is i have a folder: C:\Python with many files and many many diferrent types,i can't search and writte all extensions ) ,is there a command to Unlock ALL files from folder?this is my folder path and name : C:\Python
    « Last Edit: November 12, 2017, 06:36:44 AM by karlosss »

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Batch file to unblock files copied from internet
    « Reply #1 on: November 12, 2017, 07:57:56 AM »
    can do *.* covers all names and extensions. "Its going to target everything at that path no matter file name and extension type"

     FOR %a in (*.*) do (echo.>%a:Zone.Identifier)

    karlosss

      Topic Starter


      Beginner

      • Experience: Beginner
      • OS: Windows XP
      Re: Batch file to unblock files copied from internet
      « Reply #2 on: November 12, 2017, 10:34:25 AM »
      yes is exactelly what i want but can u make it run as batch script?

      start cmd/ FOR %a in (*.*) do (echo.>%a:Zone.Identifier)

      something like this

      DaveLembke



        Sage
      • Thanked: 662
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Batch file to unblock files copied from internet
      « Reply #3 on: November 12, 2017, 10:45:08 AM »
      To run as a batch script just need to put that into notepad and then save it as a filename.bat then launch the .bat file

      Open notepad

      copy this to it start cmd/ FOR %a in (*.*) do (echo.>%a:Zone.Identifier)

      and save as MyFirstBatch.bat and launch that and it will run.

      karlosss

        Topic Starter


        Beginner

        • Experience: Beginner
        • OS: Windows XP
        Re: Batch file to unblock files copied from internet
        « Reply #4 on: November 12, 2017, 01:28:23 PM »
        not working i rceived this error message: windows cannot find 'cmd/'.Make sure you typed the name corectly,and then try again.

        karlosss

          Topic Starter


          Beginner

          • Experience: Beginner
          • OS: Windows XP
          Re: Batch file to unblock files copied from internet
          « Reply #5 on: November 12, 2017, 01:38:29 PM »
          maybe this: start cmd /k FOR %a in (*.*) do (echo.>%a:Zone.Identifier)

          Squashman



            Specialist
          • Thanked: 134
          • Experience: Experienced
          • OS: Other
          Re: Batch file to unblock files copied from internet
          « Reply #6 on: November 12, 2017, 10:51:11 PM »
          Why are you trying to use start cmd at all.
          You don't need it when running from the cmd prompt nor do you need it running in a batch file.

          Also if you read the help for the FOR command you would see this very quickly.
          Code: [Select]
          To use the FOR command in a batch program, specify %%variable instead
          of %variable.  Variable names are case sensitive, so %i is different
          from %I.
          So your code becomes.
          Code: [Select]
          FOR %%G in (*.*) do (echo.>%%G:Zone.Identifier)

          karlosss

            Topic Starter


            Beginner

            • Experience: Beginner
            • OS: Windows XP
            Re: Batch file to unblock files copied from internet
            « Reply #7 on: November 13, 2017, 04:17:33 AM »
            yes perfect, thank you!