Windows 10: NirCmd requires you to click the .BAT file twice?

Discus and support NirCmd requires you to click the .BAT file twice? in Windows 10 Software and Apps to solve the problem; I'm using the current version, Firefox 57.0.2 I want to use a macro in Excel 2010, that runs a .BAT file with NirCmd, that goes to "Other Bookmarks"... Discussion in 'Windows 10 Software and Apps' started by mb1280, Dec 19, 2017.

  1. mb1280 Win User

    NirCmd requires you to click the .BAT file twice?


    I'm using the current version, Firefox 57.0.2

    I want to use a macro in Excel 2010, that runs a .BAT file with NirCmd, that goes to "Other Bookmarks" in Firefox . . . but I can't figure out how to get it to work.

    The closest I can get is, I open this "skin" / "chrome", which default opens to "All Bookmarks" . . . "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    But, what I want is, which can only be done from within Firefox . . . I use this Keyboard Shortcut, and it default opens to "Other Bookmarks" . . . CTRL + Shift + B

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

    I've tried many things with no luck (switches, VBA, AutoHotkey) . . . but I think this would be the simplest, with NirCmd:

    nircmd.exe and nircmdc.exe are the same, except that in the console version, all error messages go to the console window, instead of using a message box.

    Below are the commands I have tried in the .BAT file . . . separate, and then combined, to see if it will do anything . . . It seems like they should work - places.xul has the focus - but Firefox ignores what NirCmd has. Any idea what's going on?

    With "places.xul" open, and having the focus, you just have to manually hit enter, or page down and enter, to see it do something.

    I've been looking at this page to get the commands . . . NirCmd - Freeware command-line tool for Windows

    If Pagedown + Enter were sent, that should get me there.

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

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

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

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

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

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

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

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

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

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

    :)
     
    mb1280, Dec 19, 2017
    #1

  2. Windows 10 task bar won't hide

    Alternately, you may use this script (uses NirCmd anyway).

    Set WshShell = CreateObject("WScript.Shell")

    WshShell.Run "nircmd.exe win hide class Shell_TrayWnd", 0

    Copy the two lines to Notepad, and save the file with .vbs extension (hidetaskbar.vbs)

    Another script to show the taskbar.

    Set WshShell = CreateObject("WScript.Shell")

    WshShell.Run "nircmd.exe win show class Shell_TrayWnd", 0

    The Command Prompt window doesn't pop-up (as in the case of .BAT files) if you use the script method.
     
    Ramesh Srinivasan, Dec 19, 2017
    #2
  3. Taskbar

    Hi,

    Right-click Taskbar, click Properties.

    Enable "Auto-hide the taskbar"

    Click OK.

    Taskbar would become hidden, but pops up when you move the mouse pointer to the bottom. If you want to truly hide the Taskbar, try

    NirCmd
    . Running this command would hide the Taskbar.

    nircmd win hide class Shell_TrayWnd

    to show it:

    nircmd win show class Shell_TrayWnd

    You may create shortcuts to the above commands and assign hotkeys to them so that you can quickly toggle the setting back and forth when needed.

    Make sure you auto-hide the taskbar before running those commands so that you can make use of the screen space that was previously occupied by the Taskbar.
     
    Ramesh Srinivasan, Dec 19, 2017
    #3
  4. NirCmd requires you to click the .BAT file twice?

    I don't have an answer to your problem, but this post should be in the "Browsers" section, since it more related to FireFox than general software. Maybe one of the Mods here will move it. If they don't, then I would open a similar post in that section.
     
    storageman, Dec 21, 2017
    #4
  5. mb1280 Win User
    Ok, I'm getting results now, but have a bug - you have to click the .BAT file twice for it to work. Why?

    Here is the code for the .BAT FILE

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

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

    REM Sleep - fixed delay - Windows CMD - SS64.com
    REM SLEEP 2

    REM NirCmd Command Reference - wait
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" wait 2000

    REM NirCmd Command Reference - sendkey
    REM I click the .BAT file once, "places.xul" loads, and the DOS window hangs
    REM I click the .BAT file again, "places.xul" loads, it goes to "Other Bookmarks," as follows, and Exits
    REM Results of the first instance have to be left open for this to work
    REM Why can't it get this on the first try?
    REM If I pause it for 2 seconds, either way above, that doesn't help, it's the same thing
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

    REM Combined - Neither of these work, it looks like this has to be three separate commands:
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press down press enter press
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press sendkey down press sendkey enter press

    REM This works, the same buggy way as above
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown down
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

    REM Do I need "EXIT" here? It works without it:
    REM EXIT
     
    mb1280, Dec 27, 2017
    #5
  6. mb1280 Win User
    So, I'm getting closer . . . It works if I run this code manually, as two separate .BAT files, one after the other:

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

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

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

    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" win activate title "Library" focus
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown down
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

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

    . . . any idea how you get it to work using CALL, or Calling a Subroutine? I think this is the answer:

    USING A .BAT FILE
    CALL - Call one batch program from another, or call a subroutine . . . Call - Windows CMD - SS64.com

    USING VBA FROM EXCEL?
    Calling Sub and Function Procedures . . . Calling Sub and Function Procedures
     
    mb1280, Dec 27, 2017
    #6
  7. mb1280 Win User
    Here's what I figured out. There's too much to put here, so, I've put it on a 4-page PDF on my Google Docs:

    4 Ways to get to Firefox "Other Bookmarks", from slowest to fastest
    The following are 4 macros that I have in Excel 2010.
    The first two just use VBA.
    The second two use NirCmd.

    Other Bookmarks.pdf - Google Drive
     
    mb1280, Jan 7, 2018
    #7
  8. NirCmd requires you to click the .BAT file twice?

    I'm not sure what are your complete requirements ...
    It seems you want to delete a Firefox bookmark, and you want to issue the command to do so from within an Excel spreadsheet (using VBA).

    I'll accept the latter part (Excel), and approach the problem differently ...

    Firefox keeps bookmarks and lots of other configuration data in various sqlite database files.
    So I would massage the bookmark(s) by executing a simple query against the bookmark database.
    You can use Python to access the bookmarks database. But I prefer the sqlite.exe console app.

    This is easy ... and it doesn't use the Firefox GUI to carry out the changes.

    BTW ... I do this all the time to fetch and/or delete cookies from the cookies sqlite database file.
     
    margrave55, Jan 8, 2018
    #8
  9. mb1280 Win User
    . . . seems you want to delete a Firefox bookmark, and you want to issue the command to do so from within an Excel spreadsheet (using VBA)

    Yes

    . . . execute a simple query against the bookmark database . . . But I prefer the sqlite.exe console app

    Yes

    . . . This is easy

    Yes, if you know the code for it, LOL

    . . . and it doesn't use the Firefox GUI to carry out the changes.

    Cool!

    . . . BTW ... I do this all the time to fetch and/or delete cookies from the cookies sqlite database file.

    Excellent!

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

    I was using SQLite Manager to get my Bookmarks out of Firefox, but it quit working with FF57:

    SQLite Manager 0.8.3.1-signed.1-signed :: Add-ons for Firefox . . . https://addons.mozilla.org/en-US/fir...qlite-manager/

    I then found this as a replacement:

    DB Browser for SQLite . . . I got the "PortableApp" version . . . DB Browser for SQLite

    . . . but then got the notion to automate the whole process:

    bookmarks-to-CSV.pdf . . . [A pdf I have made, and uploaded to my Google Docs] . . . This first page provides all you need to know, to get your Bookmarks into a .CSV file (This won't do anything to your actual Bookmarks, it just extracts a copy of them.) . . . Then, the next few pages provide the details of what's going on . . . bookmarks-to-CSV.pdf - Google Drive

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

    So, "DB Browser for SQLite" lets me see all the fields in places.sqlite, but, questions I have are . . .

    1.) What would be the delete query for "Other Bookmarks" in SQLite3? I don't even see the "Other Bookmarks" folder.

    2.) If someone wanted to convert from having their Bookmarks in Firefox, to Excel, what fields would they need to add, in order to get their folders and sub-folders (the query I have in the above PDF just extracts the ID, Title, URL, and Date Added)

    3.) What's the query you use to see your cookies? How do you delete them them through SQLite3? Is it better than using CCleaner for some reason?
     
    mb1280, Apr 5, 2018
    #9
Thema:

NirCmd requires you to click the .BAT file twice?

Loading...
  1. NirCmd requires you to click the .BAT file twice? - Similar Threads - NirCmd requires click

  2. When you double click a text file, notepad in windows 11 opened the file twice

    in Windows 10 Software and Apps
    When you double click a text file, notepad in windows 11 opened the file twice: Notepad version tested: 11.2309.28.0In the new Notepad of windows 11, if the setting of notepad looks like this: "When Notepad starts" --> "Open content from the previous session", if you double click a text file, you will see the same file is opened twice.This looks like a...
  3. When you double click a text file, notepad in windows 11 opened the file twice

    in Windows 10 Gaming
    When you double click a text file, notepad in windows 11 opened the file twice: Notepad version tested: 11.2309.28.0In the new Notepad of windows 11, if the setting of notepad looks like this: "When Notepad starts" --> "Open content from the previous session", if you double click a text file, you will see the same file is opened twice.This looks like a...
  4. Bat file

    in Windows 10 Gaming
    Bat file: I have a bat fileI am improving it bit by bit till I have reached But not i have added a warning to it before a commandI now want to make that line font size Bigger than the others How can I do that ??So here is the Batch file content@ECHO OFF echo...
  5. Bat file

    in Windows 10 Software and Apps
    Bat file: I have a bat fileI am improving it bit by bit till I have reached But not i have added a warning to it before a commandI now want to make that line font size Bigger than the others How can I do that ??So here is the Batch file content@ECHO OFF echo...
  6. .bat files

    in Windows 10 Network and Sharing
    .bat files: So i am trying to make a minecraft server and need to open a .bat file but i keep getting a error saying "This app can not run on this pc" But it worked a month ago i need a solution please....
  7. Bat file

    in Windows 10 Ask Insider
    Bat file: Good morning/evening/night, I wanted to create a batch file or an exe that can change options inside the gui of an application (the application is cisco webex) (if you are familliar with webex i want to change the audio or turn it to music mode witha batch file) but i am...
  8. Mouse clicks twice

    in Windows 10 Drivers and Hardware
    Mouse clicks twice: This is an intermittent problem with my mouse. I click once, but the mouse clicks twice. I have: set the Double-click speed to the lowest and still have the same problem; checked to see if the driver is up to date and it is; and changed the mouse three times and still...
  9. .bat file

    in Windows 10 Customization
    .bat file: I have .bat file it is not working in my new PC when I double click on it. but it was working in my old PC. could your please support how to associate .bat file in windows 10? Kindly looking for your support and reply in this regards. Thanks.....
  10. mouse click twice

    in Windows 10 Drivers and Hardware
    mouse click twice: why do i have to click everything twice? https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware/mouse-click-twice/4eb8d09c-60d9-45f0-bcdb-aaa51309aec7