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

Author Topic: [need help] unzip the binary file copy /b in bat/vbs  (Read 6002 times)

0 Members and 1 Guest are viewing this topic.

Fareast187

    Topic Starter


    Rookie

    [need help] unzip the binary file copy /b in bat/vbs
    « on: February 05, 2011, 05:30:01 PM »
    hello everyone,

    here i have a problem to unzip the binary file with "copy /b" in my batch file program...

    ok i will explain more detail..

    first i do :-
    Code: [Select]
    copy /b *.jpg + *.zip  result.jpg
    then i rename "result.jpg" to "result.zip"

    after that i use my batch file to unzip, it won't unzip the binary file... but if i zip normally without use binary file it can be unzip...
    i use the code below..(just look at the "echo .......... >> unzip.vbs")



    Code: [Select]
    copy "kin\just\result.zip" "c:\result.zip"
    md "c:\cepat"

    echo pathToZipFile="c:\result.zip" >> unzip.vbs
    echo extractTo="c:\cepat" >> unzip.vbs
    echo.
    echo set sa = CreateObject("Shell.Application") >> unzip.vbs
    echo set filesInzip=sa.NameSpace(pathToZipFile).items >> unzip.vbs
    echo sa.NameSpace(extractTo).CopyHere(filesInzip)  >> unzip.vbs
    start unzip.vbs

    ping localhost -n 4 >nul
    copy c:\cepat "kin\just"
    ping localhost -n 4 >nul
    del "kin\just\result.zip" /q /f
    ping localhost -n 4 >nul
    del "unzip.vbs" /q /f
    ping localhost -n 2 >nul
    del "c:\cepat\*" /q /f
    ping localhost -n 4 >nul
    rmdir "c:\cepat"  /q
    ping localhost -n 4 >nul
    del "c:\result.zip" /q /f

    thank in advance for your help....

    polle123



      Rookie

      • Experience: Beginner
      • OS: Unknown
      Re: [need help] unzip the binary file copy /b in bat/vbs
      « Reply #1 on: February 06, 2011, 04:57:03 AM »
      I see that you are trying to hide files within a photo.

      I would avise using .rar files for this, instead of .zip, that fixed my problem back in the days :)

      And you shouldn't use a batch file to unzip. after renaming it to result.zip you have to right click and unzip from there

      mroilfield



        Mentor
      • Thanked: 42
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 11
      Re: [need help] unzip the binary file copy /b in bat/vbs
      « Reply #2 on: February 06, 2011, 07:33:11 AM »
      then i rename "result.jpg" to "result.zip"

      You do realize that just remaining the file from "result.jpg" to "result.zip" doesn't make it a zipped file right? If it isn't an actual zipped file then no matter what you do you won't be able to "unzip" it.
      You can't fix Stupid!!!

      Salmon Trout

      • Guest
      Re: [need help] unzip the binary file copy /b in bat/vbs
      « Reply #3 on: February 06, 2011, 08:57:28 AM »
      You do realize that just remaining the file from "result.jpg" to "result.zip" doesn't make it a zipped file right? If it isn't an actual zipped file then no matter what you do you won't be able to "unzip" it.

      Read his post. You can use the COPY command with the /b switch to join a jpg and a zip together into a third file, which you can give any extension you like. If you give it a .jpg extension, a jpeg viewer will see the jpg part and display it normally. It will not see the zip part. If you change the extension to .zip, an archive manager (Winzip, WinRar, etc) will see the zip part, but not the jpg, and process it normally. Thus you could hide a zip in a jpg or vice versa.

      What he does not seem to realise is that using wildcards and copying multiple jpegs and then multiple zips will not result in multiple hidden but accessible files. Only the first jpg and the first zip will be available, and only to a Zip program.

      Also that unlike proper Zip archive apps, the VBS unzip routines

      1. Are really "copy from compressed folder" routines, and require compressed folders to be enabled.
      2. Unlike WinZip, etc, won't like the fake "compressed folder" (zip file) resulting from the copy, and will copy nothing.









      Fareast187

        Topic Starter


        Rookie

        Re: [need help] unzip the binary file copy /b in bat/vbs
        « Reply #4 on: February 06, 2011, 11:46:11 PM »

        I would advise using .rar files for this, instead of .zip, that fixed my problem back in the days :)


        thank you very much...my problem solve now....i use RAR file and everything solve.... ;D
        actually im do a program security call  "4 gate folder security"

        like this :-
        first folder do a basic security like hidden folder or partition drives
        second folder do medium security like change extension of folder
        third folder do hard security like desktop.ini write extension of control panel(every time someone click it, it will go to control panel, if someone rename the file it will never change)
        forth folder do very hard security like hidden file inside jpg

        maybe next time i'll add one more security with make a password in the rar file..