Search found 9 matches

by Simon_Weel
2023-May-23, 8:08 am
Forum: Windows CMD Shell
Topic: from a filename to file paths
Replies: 6
Views: 220

Re: from a filename to file paths

Code: Select all

dir newdoc2023.docx /s /b >result.txt
will do?
by Simon_Weel
2023-Mar-21, 4:34 pm
Forum: Windows CMD Shell
Topic: Use SED to extract part of a line?
Replies: 8
Views: 3756

Re: Use SED to extract part of a line?

As for extracting part of a line, see https://superuser.com/a/1503852.
by Simon_Weel
2023-Jan-31, 10:31 am
Forum: Windows CMD Shell
Topic: SETX - delete environment variable
Replies: 2
Views: 805

Re: SETX - delete environment variable

Oops, missed that! :oops:
by Simon_Weel
2023-Jan-26, 12:03 pm
Forum: Windows CMD Shell
Topic: SETX - delete environment variable
Replies: 2
Views: 805

SETX - delete environment variable

I was doing some testing which incorporated a couple of environment variables. I used SETX to create those variables in the user's context to be picked up by other applications. When done testing, I wanted to get rid of them using SETX. Now there doesn't seem to be a way do delete environment variab...
by Simon_Weel
2023-Jan-04, 1:17 pm
Forum: Windows CMD Shell
Topic: Read a file, output each line to a new file, preserve all characters?
Replies: 8
Views: 1998

Re: Read a file, output each line to a new file, preserve all characters?

As you discovered, the Windows SMD Shell isn't exactly suited for this kind of jobs. You may want to look into something like Autohotkey https://www.autohotkey.com/?
by Simon_Weel
2023-Jan-04, 1:09 pm
Forum: Windows CMD Shell
Topic: Enable Yes function when prompted to enter info
Replies: 1
Views: 638

Re: Enable Yes function when prompted to enter info

Not exactly a Windows Shell problem - the message shown is UAC kicking in. Some sites to remedy this:
https://www.partitionwizard.com/partiti ... d-out.html
https://www.top-password.com/blog/uac-y ... indows-10/
by Simon_Weel
2023-Jan-04, 1:04 pm
Forum: Windows CMD Shell
Topic: Command-line switches to open explorer.exe in Win10
Replies: 1
Views: 1173

Re: Command-line switches to open explorer.exe in Win10

Not sure I get the problem, but when I try it, it works ok - it opens Explorer and selects the specified file. If the file specified doesn't exist, you'll indeed open Explorer in 'This PC'. So either make sure the file is there or specify a path only?

Code: Select all

explorer.exe /n,/e,/select,c:\Testä\Text.txt
by Simon_Weel
2022-Oct-13, 7:43 am
Forum: Windows CMD Shell
Topic: Execution depends on what comes AFTER the line in question????????
Replies: 4
Views: 1315

Re: Execution depends on what comes AFTER the line in question????????

The part that fails is this: set Pattern=%Name% set Archive=%Name% If you add quotes, the problem is solved: set Pattern="%Name%" set Archive="%Name%" But it's weird - if you execute the script line by line (copy / paste) in the command window, it won't throw an error. And I wond...
by Simon_Weel
2022-Oct-12, 2:32 pm
Forum: Windows CMD Shell
Topic: Windows Events: send e-mail
Replies: 2
Views: 1048

Windows Events: send e-mail

I've setup a task in Task Scheduler to act upon a series of events triggered by Windows Defender. When triggered, it executes a script to send me an e-mail that there's something going on with Defender. Works fine. Now I want the e-mail to be a bit more informative, like what is the event and what i...