Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Command line - Some questions

03 Apr 2014   #11
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
.
03 Apr 2014   #12
Yaron

Windows 7 Ultimate x32
 
 

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 System SpecsSystem Spec
04 Apr 2014   #13
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
.

04 Apr 2014   #14
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
04 Apr 2014   #15
Yaron

Windows 7 Ultimate x32
 
 

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 System SpecsSystem Spec
04 Apr 2014   #16
MilesAhead

Windows 7 32 bit
 
 

Ok. Thank you. :)

Edit: That Move icon does look nice. I'll try it out. :)
My System SpecsSystem Spec
04 Apr 2014   #17
Yaron

Windows 7 Ultimate x32
 
 

Great.

Thank you for your kind help.

Have a nice weekend.
My System SpecsSystem Spec
04 Apr 2014   #18
MilesAhead

Windows 7 32 bit
 
 

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 System SpecsSystem Spec
04 Apr 2014   #19
Yaron

Windows 7 Ultimate x32
 
 

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
Quote:
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
Quote:
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 System SpecsSystem Spec
31 Dec 2014   #20
Yaron

Windows 7 Ultimate x32
 
 

Hi MilesAhead,

Happy New Year.
My System SpecsSystem Spec
Reply

 Command line - Some questions




Thread Tools




Similar help and support threads
Thread Forum
Executing command line command anywhere ?
I want to create a setup whereas a command line command can be run from any directory/folder, without having to be in the directory/folder whereas the command line command resides ?
General Discussion
Command Line - Help
Hi Guy's and Girls, Just first off I've never been too good with CMD and only an Apprentice in my company I work for. Now something I've wanted to do for awhile was to make the following but I don't necassirealy I know how to do this in one batch file: I would need a Batch file that is...
General Discussion
Command line csc not working.
I am trying to use csc.exe from the command prompt to run a program called c:\code\helloworld.cs. I know the program works as I tested it using 'compile online dot com'. When I run csc, I get the following error (see jpg). How may I solve this problem, please? When I set the 'Path' to the...
General Discussion
Command Line
Is there a cmd.exe /switch for “run as administrator” ? Thanks-
General Discussion
Can you boot from the command line?
This is an off topic thread because it concerns WinXP/2000 dual boot machine which are not booting. I can get to the Windows\ and Winnt command line of each but trying to figure out if I can boot from there. If I try to boot regularly I get "missing operating system" Im trying the Windows 2000...
Chillout Room


Our Sites

Site Links

About Us

Find 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 14:03.
Twitter Facebook Google+