locked
Unzipping and zipping files in Small Basic RRS feed

Answers

  • Effrego,

    In a way this can be done in small basic.  To do it you would need to use Oskariok's extension.  Then use the Cmd.RunCmdOrBatfile command.  Here's an example.  First you have to create a .bat file with the commands that you want in it.  I did this using notepad.  The first line compresses a file.  The second line uncompresses the file into a different file.  I called this file compress.bat.

    compress c:\testing.bat c:\compress.zip /z
    expand c:\compress.zip c:\testing2.bat

    With the .bat file created you need to put this code snippet in small basic and run it.

    CMD.RunCMDorBatFile(c:\compress.bat")

    That's it.  This will compress a file and uncompress it.  There are a lot of options in the command line commands.  To see what they are do this at a command prompt.  compress /?

    Here's another way to compress and expand by using the CMD.RunCMDcommand which is simpler as you don't have to create a .bat file.

    a=CMD.runcmdcommand("/c compress c:\testing.bat c:\compress.zip")
    TextWindow.WriteLine(a)
    TextWindow.WriteLine("Here")
    b=Cmd.RunCMDcommand("/c expand c:\compress.zip c:\testing2.bat")
    TextWindow.WriteLine(b)

    Jricestk

     

    Friday, October 8, 2010 10:46 PM
    Answerer

All replies

  • No, Small Basic can't do that
    Sorry My Bad English
    Thursday, October 7, 2010 2:10 PM
  • Effrego,

    In a way this can be done in small basic.  To do it you would need to use Oskariok's extension.  Then use the Cmd.RunCmdOrBatfile command.  Here's an example.  First you have to create a .bat file with the commands that you want in it.  I did this using notepad.  The first line compresses a file.  The second line uncompresses the file into a different file.  I called this file compress.bat.

    compress c:\testing.bat c:\compress.zip /z
    expand c:\compress.zip c:\testing2.bat

    With the .bat file created you need to put this code snippet in small basic and run it.

    CMD.RunCMDorBatFile(c:\compress.bat")

    That's it.  This will compress a file and uncompress it.  There are a lot of options in the command line commands.  To see what they are do this at a command prompt.  compress /?

    Here's another way to compress and expand by using the CMD.RunCMDcommand which is simpler as you don't have to create a .bat file.

    a=CMD.runcmdcommand("/c compress c:\testing.bat c:\compress.zip")
    TextWindow.WriteLine(a)
    TextWindow.WriteLine("Here")
    b=Cmd.RunCMDcommand("/c expand c:\compress.zip c:\testing2.bat")
    TextWindow.WriteLine(b)

    Jricestk

     

    Friday, October 8, 2010 10:46 PM
    Answerer