Create text file and create zip file

Help
Jimbo
2010-07-27
2013-09-06
  • Jimbo
    Jimbo
    2010-07-27

    I'd like to add buttons to the toolbar for single click creation of a text
    file and single click creation of a zip file. What should the Command be?

     
  • Ivo Beltchev
    Ivo Beltchev
    2010-07-27

    You can create a small batch file that copies some blank txt or zip file into
    the current folder. There isn't however a way to select that new file and
    enter renaming mode for it.

     
  • John_Edward
    John_Edward
    2010-07-27

    You could also use the "%random%" tag so you can copy many files to the same
    folder if you want to.
    Just use:
    copy c:\txtfile.txt txtfile_%random%.txt
    Not sure how you can make it to copy it to the folder you are in though.

     
  • Ivo Beltchev
    Ivo Beltchev
    2010-07-27

    %1 can be used for the current directory.

     
  • Jimbo
    Jimbo
    2010-07-30

    Perfect. Thanks for the replies.
    For those that are interested, the text file batch file is as follows (my
    template file is in C:\Template):

    copy C:\Temp\Textfile.txt %1\Textfile-%RANDOM%.txt

     
  • Elaandak
    Elaandak
    2012-01-04

    Hi all..
    I'm trying to do something similar, I tested the command that (jimbo1962)
    posted but didn't work:

    copy C:\txtfile.txt %1\txt-%random%.txt
    

    Can somebody please help?
    Thanks

     
  • Elaandak
    Elaandak
    2012-01-05

    This is my setup, is there anything wrong with it?

     
  • Jimbo
    Jimbo
    2012-01-05

    note that %RANDOM% must be in uppercase.

     
  • Jimbo
    Jimbo
    2012-01-05

    You have to have the command line IN A BATCH FILE, and the toolbar button must
    call that batch file

     
  • Elaandak
    Elaandak
    2012-01-05

    Thanks jimbo1962..

    It's working now, the file is created in the same place, how can I create it
    in the current folder (a folder on desktop or D or E) for example.

    Thanks

     
  • Jimbo
    Jimbo
    2012-01-05

    To create it in the folder currently displayed in the Explorer pane:

    copy C:\Textfile.txt .\Textfile-%RANDOM%.txt

    i.e. use .\ to specify "current directory"

     
  • Elaandak
    Elaandak
    2012-01-05

    True.. that works if I have the bat file on the current folder, but what I
    want is to call that bat file form the classic shell tool bar in any folder
    without the bat inside..

    I think I have something wrong still?


    Thanks

     
  • Jimbo
    Jimbo
    2012-01-05

    OK. Step by step.
    Create a directory C:\Program Files\Classic Shell\BATCH
    Move your blank text file to this directory. I will assume the file name is
    "textfile.txt"
    Create a batch file in this directory. I will assume the file name is
    "action.bat". The content of the batch file should be:
    copy C:\Program Files\Classic Shell\BATCH\Textfile.txt .\Textfile-%RANDOM%.txt
    Create a new button on the Classic Shell Explorer toolbar. The command for
    this button should be:
    C:\Program Files\Classic Shell\BATCH\action.bat %1

     
    • Fabian
      Fabian
      2013-09-06

      I had to put the path in the batch file in quotes, to make it work for me (on Windows 8 Enterprise):

      copy "C:\Program Files\Classic Shell\BATCH\Textfile.txt" .\Textfile-%RANDOM%.txt

       
  • Elaandak
    Elaandak
    2012-01-05

    Perfect, thanks for reply, its exactly what I need.

    Regards