Search found 1973 matches
- 29 Sep 2022 08:45
- Forum: DOS Batch Forum
- Topic: [CLARIFIED] Executing command via FOR results in not recognized
- Replies: 4
- Views: 2830
Re: Executing command via FOR results in not recognized
Is there information about why FOR treats space characters as commands instead of ignoring them? It deviates from default behavior imo. It is the default behaviour: If you escape a character (using the circumflex-character '^'), or add characters when the interpreter expects text starting with esca...
- 28 Sep 2022 07:17
- Forum: DOS Batch Forum
- Topic: [CLARIFIED] Executing command via FOR results in not recognized
- Replies: 4
- Views: 2830
Re: Executing command via FOR results in not recognized
That's not "nothing" - it's a space-character. Since the space-character is no valid command, the error message is correct. Typically space characters are treated as whitespace characters and will not end up beeing treated as a command. But you can force cmd to treat the space-character as a command...
- 19 Aug 2022 02:29
- Forum: DOS Batch Forum
- Topic: How do I check the length of a filename in batch script?
- Replies: 1
- Views: 2070
Re: How do I check the length of a filename in batch script?
You could store the filename into an environment variable and then check the length of that string using the :strlen-function.
penpen
penpen
- 19 Jul 2022 02:16
- Forum: DOS Batch Forum
- Topic: How to pause and resume a task?
- Replies: 3
- Views: 3178
Re: How to pause and resume a task?
Just a small sidenote to the net-approach:
The net command (at least under windows 10) does support the switches PAUSE and CONTINUE (to pause and resume a task).
You don't need to terminate and (re)start the process (using STOP and START).
penpen
The net command (at least under windows 10) does support the switches PAUSE and CONTINUE (to pause and resume a task).
You don't need to terminate and (re)start the process (using STOP and START).
penpen
- 15 Jun 2022 02:14
- Forum: DOS Batch Forum
- Topic: How to get rid of The file cannot be copied onto itself.
- Replies: 3
- Views: 4884
Re: How to get rid of The file cannot be copied onto itself.
You should copy your files to a temporary folder (preferably on the same volume) and then move them to the final location.
penpen
penpen
- 30 May 2022 03:24
- Forum: DOS Batch Forum
- Topic: Dynamically change icon in context menu
- Replies: 38
- Views: 33089
Re: Dynamically change icon in context menu
I can't check myself (since i I have no Win11), So i can list only two potential issues i see ad hoc: Microsoft might have changed the GUID of the power plans. You could compare the GUID used in "ChangePowerPlan.reg" with the GUID listed by following command: powercfg.exe /L If there was a change, t...
- 24 May 2022 09:15
- Forum: DOS Batch Forum
- Topic: ahci.sys
- Replies: 12
- Views: 17398
Re: ahci.sys
I don't remember any driver named "AHCI.SYS", but i think i remember one named "AHCICD.SYS", so no guarantees for the following: If i remember right, then the "AHCICD.SYS" has an optional parameter "/C:<#AHCI-Controller>", where "<#AHCI-Controller>" is a digit from 0 to 9. If you leave out that para...
- 19 May 2022 06:07
- Forum: DOS Batch Forum
- Topic: Optimization of Mass Copy Via Batch
- Replies: 7
- Views: 6146
Re: Optimization of Mass Copy Via Batch
I am not familiar with NAS-devices, so the following idea might or might not be possible; typically when you want to send the same data to multiple recipients simultaneously, you would use broadcast (send to all nodes in the network) or multicast (send to multiple nodes in a network) in order to red...
- 12 May 2022 04:46
- Forum: DOS Batch Forum
- Topic: Open, Add Line, Save, Next File Help
- Replies: 6
- Views: 5315
Re: Open, Add Line, Save, Next File Help
I would expect such a result if your source files to not contain line endings at all or no line endings of the form "\r\n" (in hex "0D 0A"). On the other hand, that should have been preserved in your resulting files, which show the (windows) endline. Do you have opened and saved the resulting files ...
- 30 Apr 2022 05:02
- Forum: DOS Batch Forum
- Topic: How to define screen buffer size for "Mode 120,60" command?
- Replies: 8
- Views: 7196
Re: How to define screen buffer size for "Mode 120,60" command?
I only added a debug output, so you can see whether or not the error message is misleading.
I didn't change the program logic.
I didn't change the program logic.
- 29 Apr 2022 02:43
- Forum: DOS Batch Forum
- Topic: How to define screen buffer size for "Mode 120,60" command?
- Replies: 8
- Views: 7196
Re: How to define screen buffer size for "Mode 120,60" command?
You should test, whether or not the error text really is misleading. Since the buffer is set first, it might be smaller than the actual window size at that point: powershell.exe -noprofile -command "&{Write-Host "initial WindowSize $(get-host).UI.RawUI.WindowSize"; $w=(get-host).ui.rawui;$w.buffersi...
- 28 Apr 2022 02:52
- Forum: DOS Batch Forum
- Topic: "net view /NETWORK" does not show all computers in inhouse LAN
- Replies: 1
- Views: 3753
- 15 Feb 2022 08:10
- Forum: DOS Batch Forum
- Topic: Batch file to merge two column strings from two files into one file
- Replies: 4
- Views: 5411
Re: Batch file to merge two column strings from two files into one file
Just wanted to mention that you might get unwanted results, if your example is not representative. In SQL terms (which is the easiest to describe a possible issue): If you assume the line number to be the related column to join, then the the solution is a natural inner join. If that is, what you wan...
- 07 Feb 2022 13:25
- Forum: DOS Batch Forum
- Topic: Batch command
- Replies: 2
- Views: 3679
Re: Batch command
Batch is an interpreter language, which means that the interpreter is always loaded (which under windows typically is cmd.exe).
So, maybe your batch file but leaving out the first line ("start cmd.exe") is, what you are looking for.
penpen
So, maybe your batch file but leaving out the first line ("start cmd.exe") is, what you are looking for.
penpen
- 07 Feb 2022 13:03
- Forum: DOS Batch Forum
- Topic: Replace strings scripts not done good job
- Replies: 5
- Views: 4694
Re: Replace strings scripts not done good job
Yes, within batch the double quote guarantees you to parse the string as a whole. But you then replace the string without those doublequotes (which is exactly, what you want, because there are no double quotes int the text files you change). The question then is, do you want to allow partial string ...