Search found 190 matches

by Simon Sheppard
2023-Mar-20, 12:20 pm
Forum: Windows CMD Shell
Topic: For loops: Is there any reason you HAVE to use different tokens?
Replies: 1
Views: 2133

Re: For loops: Is there any reason you HAVE to use different tokens?

Using extra characters is not about nesting, but about having the option to use more than 26 TOKENS, so for example you might want to parse some data out of a CSV file with more than 26 columns. Each FOR command instantiates a new instance in memory which inherits all the variables of the parent pro...
by Simon Sheppard
2023-Mar-20, 12:10 pm
Forum: Windows CMD Shell
Topic: Use SED to extract part of a line?
Replies: 10
Views: 27691

Re: Use SED to extract part of a line?

Nice solution :)
by Simon Sheppard
2023-Mar-19, 12:38 pm
Forum: General Tech News, Notes and Queries
Topic: Edit a Windows 11 setting using batch
Replies: 1
Views: 13173

Re: Edit a Windows 11 setting using batch

Most of these settings can be found in the registry e.g. HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad 32-Bit DWORD value AAPThreshold . 0 = Most sensitive 1 = High sensitivity 2 = Medium sensitivity (default) 3 = Low sensitivity So first I would look at that in reged...
by Simon Sheppard
2023-Mar-12, 1:48 pm
Forum: Windows CMD Shell
Topic: Use SED to extract part of a line?
Replies: 10
Views: 27691

Re: Use SED to extract part of a line?

SED is a stream editor intended to modify a files contents rather than extracting values from it. if you want to use bash utilities, I would start by using head and tail to extract just line 35. Then when you have that single line, use grep to extract the part you need. If you want to do this in nat...
by Simon Sheppard
2023-Mar-03, 10:59 pm
Forum: Windows PowerShell
Topic: Mapping Accessible Network Shares via Powershell
Replies: 1
Views: 11079

Re: Mapping Accessible Network Shares via Powershell

There isn't quite enough info in your question to give much advice, it really depends how you have structured all the file shares.

If you turn on Access-based Enumeration then you can just map one level and the sub folders will automatically appear if the user has permission to them.
by Simon Sheppard
2023-Mar-02, 9:09 am
Forum: Windows CMD Shell
Topic: Is there any way to modify a variable twice in the same IF comparison?
Replies: 7
Views: 7160

Re: Is there any way to modify a variable twice in the same IF comparison?

Hello Hello There Is exactly what i would expect to get because you are not using delayed expansion, so everything within the brackets is treated like a single line as far as variable expansion goes. You can SET variables, but reading them will get the value as evaluated at the start of the code bl...
by Simon Sheppard
2023-Mar-01, 3:49 pm
Forum: Windows CMD Shell
Topic: Is there any way to modify a variable twice in the same IF comparison?
Replies: 7
Views: 7160

Re: Is there any way to modify a variable twice in the same IF comparison?

In your second script you have
call if %x% equ 1 (

call if is not supported (nor is CALL FOR, see https://ss64.com/nt/call.html )

If you remove the CALL then it works as expected.
by Simon Sheppard
2023-Feb-22, 12:47 am
Forum: Windows CMD Shell
Topic: Batch Script not Executing filename + Parameters
Replies: 4
Views: 85826

Re: Batch Script not Executing filename + Parameters

I don't think there is any easy way to do what you want, echoing out the values will always include a line return/termination. Some options to consider: 1) Capture all the values from the user into variables and construct & run the command. 2) Use the CLIP command to store all the items in the c...
by Simon Sheppard
2023-Feb-04, 10:28 pm
Forum: Windows CMD Shell
Topic: Putting the output of Tasklist into a variable?
Replies: 4
Views: 5291

Re: Putting the output of Tasklist into a variable?

Try running

Code: Select all

tasklist /nh /v /fi "WINDOWTITLE eq Untitled - Notepad" 1>demo.txt
and see if that puts the message into the file, if not it may be using the error stream, so try it with 2>demo.txt
by Simon Sheppard
2023-Feb-04, 6:01 pm
Forum: Windows CMD Shell
Topic: Putting the output of Tasklist into a variable?
Replies: 4
Views: 5291

Re: Putting the output of Tasklist into a variable?

When I run your code it returns
INFO:
The first token from the FOR command, which is what I'd expect, if you arent getting that, then something else is going on.