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 Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
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
What is wrong with this command line?
Help please I am pulling my hair out. I use a desktop shortcut to run an application called get_iplayer.cmd located in the directory c:\program files\get_iplayer The line in the Target of the shortcut properties therefore reads: C:\Windows\System32\cmd.exe /k "c:\program...
General Discussion
UAC bug with runas from command line?
Hi Folks, I am experiencing what I believe is a bug with UAC in Windows 7. I would like to see if anyone can recreate this issue and tell me if it is a bug or is working as expected. To recreate the issue: 1. Confirm the following local security policy setting is Enabled. Local Policies...
General Discussion
Gpedit via command line
how can I enable disable a policy using gpedit! Not via the GUI, you go do some clicks and enable. But I want to execute one shot command which will say disable AutoRun. I have searched exenstively, no results. I kind need this for my automation stuff. Thanks, Akshay
Performance & Maintenance
libraries and the command line
I am a long time programmer and computer science professor, since 1979. I grew up with the command line and like it just fine. But Windows 7 seems to change the GUI way of doing things and not mess with the command line. Yesterday I was at the command prompt and went to C:\users\Stockwell and...
Performance & Maintenance
Command Line
Is there a cmd.exe /switch for “run as administrator” ? Thanks-
General Discussion


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 21:45.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App