Can I Add this to the Right-click Menu ?

BuckSkin

New member
Power User
VIP
Local time
11:35 AM
Messages
521
How can I add THIS to the ordinary Right-click menu ?

"dir /b > filenames.txt" - without the quotation marks

Also, what would the command be to list all Foldernames instead of Filenames ? to include sub-foldernames as well ?

I already have both "Copy Filenames to the Clipboard" and "Copy Foldernames to the Clipboard" within my Right-click menu; and, executing either briefly brings up the Command Prompt window; so, by that, I figure what I seek is definitely doable.

Thanks for helping.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell Optiplex 780m "mini-tower"
OS
Windows 7 Pro x64
CPU
Intel Core Two Duo E8600 3.33 ghz
Motherboard
Whatever DELL put in it
Memory
8GB
Graphics Card(s)
Gigabyte Radeon R7 240
Monitor(s) Displays
HP 2159m
PSU
750 Watt Corsair CX750
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Browser
Chrome, Firefox, IE
Create a cmd file to add not sure what your trying to do but full list of dir

[TABLE="class: table table-sm margin-top-none"]
[TR]
[TH]Parameter[/TH]
[TH]Description[/TH]
[/TR]
[TR]
[TD][<drive>:][<path>][/TD]
[TD]Specifies the drive and directory for which you want to see a listing.[/TD]
[/TR]
[TR]
[TD][<filename>][/TD]
[TD]Specifies a particular file or group of files for which you want to see a listing.[/TD]
[/TR]
[TR]
[TD]/p[/TD]
[TD]Displays one screen of the listing at a time. To see the next screen, press any key.[/TD]
[/TR]
[TR]
[TD]/q[/TD]
[TD]Displays file ownership information.[/TD]
[/TR]
[TR]
[TD]/w[/TD]
[TD]Displays the listing in wide format, with as many as five file names or directory names on each line.[/TD]
[/TR]
[TR]
[TD]/d[/TD]
[TD]Displays the listing in the same format as /w, but the files are sorted by column.[/TD]
[/TR]
[TR]
[TD]/a[[:]<attributes>][/TD]
[TD]Displays only the names of those directories and files with your specified attributes. If you don't use this parameter, the command displays the names of all files except hidden and system files. If you use this parameter without specifying any attributes, the command displays the names of all files, including hidden and system files. The list of possible attributes values are:
  • d - Directories
  • h - Hidden files
  • s - System files
  • l - Reparse points
  • r - Read-only files
  • a - Files ready for archiving
  • i - Not content indexed files
You can use any combination of these values, but don't separate your values using spaces. Optionally you can use a colon (:) separator, or you can use a hyphen (-) as a prefix to mean, "not". For example, using the -s attribute won't show the system files.[/TD]
[/TR]
[TR]
[TD]/o[[:]<sortorder>][/TD]
[TD]Sorts the output according to sortorder, which can be any combination of the following values:
  • n - Alphabetically by name
  • e - Alphabetically by extension
  • g - Group directories first
  • s - By size, smallest first
  • d - By date/time, oldest first
  • Use the - prefix to reverse the sort order
Multiple values are processed in the order in which you list them. Don't separate multiple values with spaces, but you can optionally use a colon (:).If sortorder isn't specified, dir /o lists the directories alphabetically, followed by the files, which are also sorted alphabetically.
[/TD]
[/TR]
[TR]
[TD]/t[[:]<timefield>][/TD]
[TD]Specifies which time field to display or to use for sorting. The available timefield values are:
  • c - Creation
  • a - Last accessed
  • w - Last written
[/TD]
[/TR]
[TR]
[TD]/s[/TD]
[TD]Lists every occurrence of the specified file name within the specified directory and all subdirectories.[/TD]
[/TR]
[TR]
[TD]/b[/TD]
[TD]Displays a bare list of directories and files, with no additional information. The /b parameter overrides /w.[/TD]
[/TR]
[TR]
[TD]/l[/TD]
[TD]Displays unsorted directory names and file names, using lowercase.[/TD]
[/TR]
[TR]
[TD]/n[/TD]
[TD]Displays a long list format with file names on the far right of the screen.[/TD]
[/TR]
[TR]
[TD]/x[/TD]
[TD]Displays the short names generated for non-8dot3 file names. The display is the same as the display for /n, but the short name is inserted before the long name.[/TD]
[/TR]
[TR]
[TD]/c[/TD]
[TD]Displays the thousand separator in file sizes. This is the default behavior. Use /-c to hide separators.[/TD]
[/TR]
[TR]
[TD]/4[/TD]
[TD]Displays years in four-digit format.[/TD]
[/TR]
[TR]
[TD]/r[/TD]
[TD]Display alternate data streams of the file.[/TD]
[/TR]
[TR]
[TD]/?[/TD]
[TD]Displays help at the command prompt.[/TD]
[/TR]
[/TABLE]



To add a command prompt (cmd) file to the right-click menu in Windows 7, you can create a registry entry that links the command to the desired file type or folder. This allows you to right-click a file or folder and execute the cmd file. Here's how to do it: 1. Open Registry Editor: Press Win + R, type regedit, and press Enter. 2. Navigate to the appropriate key: For folders: HKEY_CLASSES_ROOT\Directory\shell For files (e.g., .txt): HKEY_CLASSES_ROOT\.txt\shell (replace .txt with your desired extension) 3. Create a new key: Right-click on shell, select "New" -> "Key". Name it something descriptive (e.g., "Open with MyCmd"). 4. Create a subkey for the command: Right-click on the newly created key (e.g., "Open with MyCmd"), select "New" -> "Key", and name it "command". 5. Set the command: Double-click the "Default" value under the "command" key. In the "Value data" field, enter the full path to your .cmd file, enclosed in quotes (e.g., "C:\path\to\your\script.cmd"). 6. Add an icon (optional): You can add an icon to the menu item by creating a string value named Icon under the main key (e.g., "Open with MyCmd"). Set its value to the path of an icon file (e.g., "C:\path\to\your\icon.ico"). 7. Add a verb (optional): If you want to specify a verb (like "open" or "runas") for the command, create a string value named Verb under the main key (e.g., "Open with MyCmd"). Set its value to the desired verb (e.g., "open"). 8. Add an icon for Run as Administrator (optional): You can add a separate command for running as administrator by creating a new key under HKEY_CLASSES_ROOT\Directory\shell named CmdShell. Then, create a subkey named shell\runas and set its Icon value to the path of the cmd.exe icon and its MUIVerb value to "&Run as Administrator". Finally, create a subkey named command under shell\runas and set its Default value to cmd.exe /s /k pushd "%V".
 

My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
Back
Top