Search found 190 matches

by Simon Sheppard
2024-Jan-13, 2:38 pm
Forum: Windows PowerShell
Topic: day of year: descendant, ascendant
Replies: 2
Views: 1668

Re: day of year: descendant, ascendant

$mydate = get-date $year = ($mydate).year $dayofYear = get-date -uformat "%j" $days = 365 if ([datetime]::IsLeapYear($year)) {$days = 366} Echo "Days in Year= $days" Echo "Day of year= $dayofYear" Echo "Diff= $($days-$dayofYear)" Days in Year= 366 Day of year...
by Simon Sheppard
2024-Jan-11, 5:33 pm
Forum: Windows CMD Shell
Topic: stringlength.cmd - just created - for anybody who can use it
Replies: 2
Views: 13574

Re: stringlength.cmd - just created - for anybody who can use it

I think the hash sign is there to cover the case where an empty string is passed. Otherwise set "s=" would remove the variable and cause errors. The indexing of a variable starts at 0 and the smallest number in the sequence (4096 2048 1024 512 256 128 64 32 16 8 4 2 1) is 1, so character 0...
by Simon Sheppard
2024-Jan-10, 6:29 pm
Forum: Windows CMD Shell
Topic: How to replace the script name %~n0 with a string of "-" characters of length %~n0?
Replies: 2
Views: 1557

Re: How to replace the script name %~n0 with a string of "-" characters of length %~n0?

First you can use StrLen to get the length of the string https://ss64.com/nt/syntax-strlen.html Then two approaches: Write a FOR /L loop which will build up the string you desire. https://ss64.com/nt/for_l.html or Create a string far longer than you are likely to need SET "mystr=---------------...
by Simon Sheppard
2024-Jan-08, 9:43 pm
Forum: Windows CMD Shell
Topic: TIMEOUT -T
Replies: 4
Views: 2445

Re: TIMEOUT -T

Fixed now, thanks!
by Simon Sheppard
2023-Dec-31, 2:14 pm
Forum: Windows CMD Shell
Topic: Create a CMD task that uses a small amount of cpu
Replies: 1
Views: 1413

Re: Create a CMD task that uses a small amount of cpu

You could just write a test script that counts up to 1 billion or something, analysing CPU usage in real time can be quite hard to do accurately as every action you take will itself affect CPU. High CPU usage often just means that your CPU is being used optimally, the faster a task can complete, the...
by Simon Sheppard
2023-Dec-30, 1:17 pm
Forum: Windows VBScript
Topic: VBScript deprecation
Replies: 1
Views: 4917

Re: VBScript deprecation

The latest version as of today is 5.812 (November 2023) main files: C:\Windows\System32\cscript.exe C:\Windows\System32\wscript.exe C:\Windows\System32\vbscript.dll C:\Windows\SysWow64\cscript.exe C:\Windows\SysWow64\wscript.exe C:\Windows\SysWow64\vbscript.dll Currently you can download this: Windo...
by Simon Sheppard
2023-Dec-24, 1:28 pm
Forum: Meta: Site Feedback / Forum Q&A
Topic: download link of NVSPBIND
Replies: 4
Views: 14370

Re: download link of NVSPBIND

Pranav wrote: 2023-Nov-30, 1:16 pm
Simon Sheppard wrote: 2023-Jun-29, 5:17 pm Theres an archive copy here
Looks like the Hyper-V team have abandoned this though.
Hi friend
Why Hyper-V team have abandoned this though?
The supported method is now PowerShell Get/Set-NetAdapterBinding
by Simon Sheppard
2023-Dec-23, 5:48 pm
Forum: Meta: Site Feedback / Forum Q&A
Topic: Mobile 20 not working
Replies: 1
Views: 4370

Re: Mobile 20 not working

Hi elzopi In the mobile version you now have to type at least 8 characters of the main password. Using a very short password in the non-mobile version will throw a warning but still generate a password. This change is to discourage insecure very short main passwords. If you really want the old behav...