Command line - Some questions

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 5,092
    Windows 7 32 bit
       #11

    You shouldn't use batch because you can run whatever you want from VBScript. The only processing of files should be done by the first instance of the script. Any new copies of the script should just hand the file or folder path to the first copy. Once you have that perfected then you can put any commands in.

    In fact I would be surprised if WinRar didn't have an option for a file with the list of files to add to the archive. The first copy of the script builds this list. When no more programs come up handing it more filenames, it runs WinRar.

    If you post what you are looking for on a VBS forum someone may take you the rest of the way. I do a VBS script about one every 3 months and only a few lines. It's not my strong suit. :)
      My Computer


  2. Posts : 122
    Windows 7 Ultimate x32
    Thread Starter
       #12

    Thank you for your patience and kindness.
    I didn't think it would be so complicated. :)
    I'll keep looking for a solution in different forums. I'll update.
      My Computer


  3. Posts : 5,092
    Windows 7 32 bit
       #13

    Yeah, Explorer firing off a program copy for each file makes it funky. Another approach you could do is Shift Right click and do Copy As Path and paste the filenames all at once to a text file. The result looks like this:

    "C:\download\bbceditor.zip"
    "C:\download\bluegriffon-1.7.2.exe"
    "C:\download\BootUITuner.zip"
    "C:\download\BrowserBunch.zip"
    "C:\download\BRU_Setup_WinNTx64.exe"
    "C:\download\ccsetup406.zip"

    You may need to use search and replace to get rid of the quotes.
      My Computer


  4. Posts : 5,092
    Windows 7 32 bit
       #14

    Yet another approach would be to use my hotkey utility Selector. For it to work you would make a shortcut for WinRar with the command line. You must leave the command line so that the files to be added to the archive can be tacked on at the end. You hit the hotkey to Selector and drag the WinRar shortcut and drop it on the List. Now that shortcut will remain in the list until removed.

    The way it would work is, you select a bunch of files in Explorer and hit the Selector hotkey. Click on the WinRar shortcut in the list, and hit the Go Button. Selector adds all the filenames it copied to the clipboard, to the shortcut Target line and launches the shortcut.

    See the Readme.txt file and also you can press F1 while Selector is the active window, to get help.
      My Computer


  5. Posts : 122
    Windows 7 Ultimate x32
    Thread Starter
       #15

    Thank you. You're the best. :)

    Those are great ideas, but practically I think that just renaming the file would be easier for me.

    ***

    Thanks again for MoveIt. It's really good.
    I've found two nice icons for the tool. You might like them.

    move icons, free icons in The Spherical, (Icon Search Engine)
    Move Icon from the Blue Velvet Set - DryIcons
      My Computer


  6. Posts : 5,092
    Windows 7 32 bit
       #16

    Ok. Thank you. :)

    Edit: That Move icon does look nice. I'll try it out. :)
      My Computer


  7. Posts : 122
    Windows 7 Ultimate x32
    Thread Starter
       #17

    Great.

    Thank you for your kind help.

    Have a nice weekend.
      My Computer


  8. Posts : 5,092
    Windows 7 32 bit
       #18

    You too. If you get everything settled how you would process the files I may be able to throw together a short program. From inside scripting it's much easier to do things like split off the main filename with no path or extension and add the desired extension. That type of thing is tougher with only batch. A batch expert may have no trouble but I use batch for the easy stuff. I'm no expert.

    If I know the exact program usage with params for a particular case I may be able to generalize it using AutoHotkey or a similar scripting language. Whichever way ends up easier. :)
      My Computer


  9. Posts : 122
    Windows 7 Ultimate x32
    Thread Starter
       #19

    You don't give up. :)
    I appreciate the perseverance.

    Let’s assume we have the following structure:
    A folder called TestMain.
    TestMain contains 2 files: A, B.
    And also a folder called TestSub.

    The default “Compress to” works as follows:
    If you only select file A (and right-click), you get “Compress to A.zip”.
    If you only select folder TestSub (and right-click), you get “Compress to TestSub.zip”.
    If you select more than one item, you get “Compress to TestMain.zip” and the selected items are compressed into a single file.

    Trying to emulate this behavior with "Compress to XPI":
    When using
    for %%a in (.) do set CurrentFolder=%%~nxa
    "C:\Program Files\WinRar\WinRar" a -afzip -r "%CurrentFolder%.xpi"
    WinRar compresses all items in ZIP format, and the file name is TestMain.xpi (the switch “-r”: include sub folders).
    - That's good if you select all items.

    When using
    set file=%~f1
    "C:\Program Files\WinRar\WinRar" a -afzip "%file:~0,-4%.xpi" "%1"
    Only the file on which you right-click is compressed.
    - That's good if you select one file.

    - We have to get the name of TestSub if it's the only selected item.
    - We have to determine whether one item is selected or more.
    - We have to be able to compress 2 selected items into a single file.

    ***
    And thank you again. What can I say? :)
      My Computer


  10. Posts : 122
    Windows 7 Ultimate x32
    Thread Starter
       #20

    Hi MilesAhead,

    Happy New Year.
      My Computer


 
Page 2 of 3 FirstFirst 123 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:31.
Find Us