Search found 177 matches
- 2022-Jan-23, 1:30 pm
- Forum: Windows CMD Shell
- Topic: CMD Prompt: Copying to Clipboard Adds Trailing Space
- Replies: 1
- Views: 2411
Re: CMD Prompt: Copying to Clipboard Adds Trailing Space
I think what is happening here is that the carriage return/newline are converted into a space If we try this (for %a in (red green blue) do @(echo %a)) | find "e">demo.txt it adds those spaces, the same as clip - so the problem is in the pipe not in the clip utility. In PowerShell: PS C:\>...
- 2022-Jan-22, 11:42 am
- Forum: Meta: Site Feedback / Forum Q&A
- Topic: Keyboard shortcuts to navigate SS64.com
- Replies: 0
- Views: 20245
Keyboard shortcuts to navigate SS64.com
The A-Z index pages now have keyboard shortcuts from [a] to [z] to quickly scroll up / down. The detail pages have [s] for Syntax and [e] to jump to Examples, [a] will go to the top of the page. There is also [\] to set focus on the site search box. This also involved some CSS changes so if the sear...
- 2022-Jan-20, 6:35 pm
- Forum: Windows CMD Shell
- Topic: stampme.cmd anyway to make it use 2 digit month and day and am/pm
- Replies: 4
- Views: 5880
Re: stampme.cmd anyway to make it use 2 digit month and day and am/pm
Thanks for the heads up! That robocopy script failed for me on the latest Windows 10, but this version looks promising @echo off for /f "tokens=1-6 delims=/: " %%a in ('robocopy "|" . /njh ^| find ":"') do ( set "_year=%%a" & set "_month=%%b" &am...
- 2022-Jan-15, 8:03 pm
- Forum: Windows CMD Shell
- Topic: stampme.cmd anyway to make it use 2 digit month and day and am/pm
- Replies: 4
- Views: 5880
Re: stampme.cmd anyway to make it use 2 digit month and day and am/pm
WMIC has now been deprecated, it does still work for now but who knows how much longer it may last.
So I have re-written the StampMe example page so that it now uses Robocopy, based on npocmaka's script on StackOverflow.
So I have re-written the StampMe example page so that it now uses Robocopy, based on npocmaka's script on StackOverflow.
- 2022-Jan-12, 11:16 pm
- Forum: General Tech News, Notes and Queries
- Topic: Windows Terminal to become the Default in Windows 11
- Replies: 0
- Views: 22161
Windows Terminal to become the Default in Windows 11
Over the course of 2022, we are planning to make Windows Terminal the default experience on Windows 11 devices. We will start with the Windows Insider Program and start moving through rings until we reach everyone on Windows 11. - Windows Command Line Blog
- 2022-Jan-02, 1:42 am
- Forum: Windows CMD Shell
- Topic: Using the Windows port of SED?
- Replies: 1
- Views: 2600
Re: Using the Windows port of SED?
The GnuWin32 version of sed only supports double quotes, because thats all the CMD shell understands.
An alternative would be to run Cygwin, which is more like a Unix shell so I think it gives you more quoting options.
Code: Select all
sed "s/test/text/" test.txt
- 2021-Dec-20, 8:11 pm
- Forum: Windows PowerShell
- Topic: prepend each object
- Replies: 2
- Views: 13691
Re: prepend each object
Hi querty That can be done using the Subexpression operator inside a string . $objects = systeminfo.exe /FO CSV 2>&1| ConvertFrom-Csv; $objects.'Total Physical Memory'; $objects.'Available Physical Memory'; $objects.'Virtual Memory: Max Size'; $objects.'Virtual Memory: Available'; $objects.'Virt...
- 2021-Dec-17, 8:10 pm
- Forum: Windows CMD Shell
- Topic: CMD Random
- Replies: 2
- Views: 2913
Re: CMD Random
When you divide %RANDOM% by 32768 you will get a random number between 0 and almost 1 (0.999969) notice we are dividing by 327 68 rather than 32767, so we should never get 1 which would give us an uneven distribution of numbers. if you multiply that by 6 you will get a random number between 0 and 5....
- 2021-Dec-17, 1:01 am
- Forum: Meta: Site Feedback / Forum Q&A
- Topic: Comments by first time visitor man (date)
- Replies: 1
- Views: 13001
Re: Comments by first time visitor man (date)
I'm not sure adding a date would really help much with this, there are so many differences across different distributions the only way to be sure is to run the man command and compare the options for yourself.
- 2021-Dec-10, 11:59 am
- Forum: Windows CMD Shell
- Topic: File Directory Redirection with appended text
- Replies: 1
- Views: 2073
Re: File Directory Redirection with appended text
In PowerShell $files = dir c:\filepath\*.trn $files | foreach-object {echo "RESTORE LOG [dbName] FROM DISK =' $_.name ' WITH NORECOVERY"} In CMD FOR /f %%G in ('dir /b c:\filepath\*.trn') do echo RESTORE LOG [dbName] FROM DISK =' %%G ' WITH NORECOVERY In both cases you can redirect the out...