Computer Hope

Software => Computer software => Topic started by: slack7639 on March 27, 2018, 12:37:21 PM

Title: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: slack7639 on March 27, 2018, 12:37:21 PM
Win 10 File Explorer defaults to opening to the "Home" tab, which I don't use too much - so I wanted it to open to "View"

It's kind of confusing to figure out how to use NirCmd.  As I have read elsewhere, NirCmd's help file is not that comprehensive.

Is there a page somewhere that fills this need, showing you how to do common, useful things with it?

For example, I would add this (my comments are in the REM - for example, why doesn't it say anywhere that you need to "wait"?)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@ECHO OFF

REM 1.) Without START "", alt+v makes it necessary to do Esc Esc to get rid of the letters (No)
REM 2.) If you don't wait, then the commands are not received
REM 500 isn't always enough time.  Go between that and 1000?  Sometimes 750 is too fast.
REM But then you get the letters.  So at 500, it's not giving it enough time to bring those up.

START "" "C:\Windows\Explorer.exe" "C:\1\02 projects A\A"

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" wait 1000

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey alt press
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey v press

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey Esc press
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey Esc press
Title: Re: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: soybean on March 28, 2018, 09:43:45 AM
I'm not familiar with NirCmd.  An alternative might be deciphered from https://www.winhelp.us/change-folder-views-and-options-in-windows.html
Title: Re: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: patio on March 28, 2018, 09:55:59 AM
See Here... (http://www.nirsoft.net/utils/nircmd2.html#using)
Title: Re: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: slack7639 on March 28, 2018, 10:12:05 AM
Soybean - That looks like just working with folders.  I think it would be a switch for the "View" tab, but I don't think that exists

Patio - Yes, NirCmd has a help file, but what I'm getting at is . . . do you see anything there that says you need to have NirCmd "wait" for one second for the program to open, before it sends the keys you want?  I don't . . . So, this makes it quite confusing when you use the Help File syntax, and then nothing happens . . . That's why I'm saying, it would be good if someone had a page devoted to explaining basic things like that, and everyday "useful" applications.

Here are a couple of others I use.

The first one opens Skype, gives it my password, and logs me in . . . How does just putting the pw into the clipboard make it automatically enter into Skype?

The second BAT file is a fast way to close Skype, completely, not have it in the Notification Area.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

START "" "C:\Program Files (x86)\Skype\Phone\Skype.exe"

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" clipboard set ThisIsMyPassword

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" closeprocess Windows Command Processor

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" closeprocess skype.exe

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Title: Re: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: slack7639 on March 29, 2018, 12:03:33 PM
Here are some other uses I have found for NirCmd:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Use these in two BAT files, to quickly toggle between headset and speakers:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Logitech Headset" 1
START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Logitech Headset" 2

START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Logitech Mic" 1
START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Logitech Mic" 2

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Desktop Speakers" 1
START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Desktop Speakers" 2

START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Stereo Mix Input" 1
START "" /B "C:\Program Files (x86)\NIRCMD\nircmdc.exe" setdefaultsounddevice "Stereo Mix Input" 2

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Use this in a BAT file to do Standby:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@ECHO OFF

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" standby

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Use this in a BAT file to move something to the Recycle Bin:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@ECHO OFF

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" moverecyclebin "C:\Users\MyUserName\Desktop\output.csv"

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

With Firefox open, use one or the other of these to get to "Other Bookmarks" (Ctrl+Shift+B).

A question I have is, how much of a difference is there between using "press" vs. "down" and "up" ?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@ECHO OFF

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown press
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@ECHO OFF

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown down
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown up

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Title: Re: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: patio on March 29, 2018, 05:44:13 PM
As always when we get batch requests the goal changes midstream...i hope you find a solution to your original query...
Title: Re: Win 10 File Explorer - open to a folder, to the View tab, using NirCmd
Post by: slack7639 on March 29, 2018, 08:07:30 PM
I'm just showing some uses I've had for NirCmd (for below) . . . and there are a couple of questions in there.

My other question is, could there be a forum just for NirCmd, and some tutorials

In the forum, people can ask about what's confusing them, or provide examples of what they've done
Title: NirCmd - Auto Login to Yahoo Mail
Post by: slack7639 on April 21, 2018, 10:03:08 AM
Here's how to use NirCmd to log you into your Yahoo E-mail account, and then go to Yahoo Mail Basic.

If you don't want it to go to Yahoo Mail Basic, leave off that last part.

Key things to know about NirCmd are:  activate ititle, max ititle, and wait . . . It took me a while to figure this out

I have another version of this for my Startup BAT, where it waits 10 seconds (10000), then it works.

Is there a way to combine all of the tabs onto one line, or do they have to be separate lines like this?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@ECHO OFF

START "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "https://att.yahoo.com/mail"
nircmd.exe wait 8000

nircmd.exe win activate ititle "AT&T - Login - Mozilla Firefox"
nircmd.exe win max ititle "AT&T - Login - Mozilla Firefox"
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe clipboard set [email protected]
nircmd.exe sendkeypress ctrl+v

nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey enter press
nircmd.exe wait 4000

nircmd.exe win max ititle "[email protected] - att.net Mail - Mozilla Firefox"

nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe sendkey tab press
nircmd.exe wait 1000

nircmd.exe clipboard set "https://mail.yahoo.com/neo/b/launch?.src=neo&reason=ymv_mismatch"
nircmd.exe sendkeypress ctrl+v
nircmd.exe sendkey enter press

EXIT

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -