Search found 1160 matches

by ShadowThief
07 Mar 2023 22:30
Forum: DOS Batch Forum
Topic: Check File Size Properties
Replies: 12
Views: 4193

Re: Check File Size Properties

If all you need is the size of some folder, that's been posted on here before: viewtopic.php?t=9615
by ShadowThief
06 Mar 2023 23:22
Forum: DOS Batch Forum
Topic: Check File Size Properties
Replies: 12
Views: 4193

Re: Check File Size Properties

I don't understand why you need this. Just right-click the first folder and select Properties, and then right-click the second folder and select Properties. There's no need to bring a script into this at all based on what you've described so far.
by ShadowThief
15 Feb 2023 23:16
Forum: DOS Batch Forum
Topic: Automatically uninstall a program
Replies: 2
Views: 1614

Re: Automatically uninstall a program

Does it actually show up in wmic product list as HardwareComponents? Is there a .msi file associated with it? Both of these things are required to be able to do what you're trying to do.
by ShadowThief
13 Feb 2023 21:22
Forum: DOS Batch Forum
Topic: DEL oldfiles
Replies: 10
Views: 3175

Re: DEL oldfiles

Would it be faster to move all the files that are younger than 3 days old somewhere else and then delete the folders entirely? Barring that, BestBuy is currently selling 18 TB external hard drives for $290, which is cheaper than they're usually going for. It may be worth upgrading your storage so th...
by ShadowThief
13 Feb 2023 19:09
Forum: DOS Batch Forum
Topic: DEL oldfiles
Replies: 10
Views: 3175

Re: DEL oldfiles

Delete fewer files?
by ShadowThief
13 Feb 2023 00:36
Forum: DOS Batch Forum
Topic: DEL oldfiles
Replies: 10
Views: 3175

Re: DEL oldfiles

That's what the forfiles command is for.

Code: Select all

forfiles /p "C:\what\ever" /s /m *.* /D -<number of days> /C "cmd /c del @path"
See https://stackoverflow.com/questions/510 ... han-n-days for more examples.
by ShadowThief
04 Jan 2023 05:28
Forum: DOS Batch Forum
Topic: Survey Popup - RESULTS
Replies: 8
Views: 76478

Re: Survey Popup - RESULTS

Because this is a specialized forum about a specific topic. I'd like to direct your attention to the very top of the website, where it reads "A Forum all about DOS Batch." Admittedly this isn't as true as it used to be since command.com was deprecated in Windows NT, but it's still batch. If you want...
by ShadowThief
08 Dec 2022 02:25
Forum: DOS Batch Forum
Topic: Can't change directory using cmd script
Replies: 2
Views: 6917

Re: Can't change directory using cmd script

That error you're getting means that your script is not saved with the correct encoding. Save your script as ANSI (or UTF-8 if you absolutely have to, but ANSI works best).
by ShadowThief
07 Dec 2022 04:52
Forum: DOS Batch Forum
Topic: Putting code output into a variable for string matching
Replies: 4
Views: 4589

Re: Putting code output into a variable for string matching

Correct; the code doesn't work if it stops being all on one line because of how the powershell is being executed. I only split it up to make it easier to read, I didn't add line continuation characters to make it keep working. If you want to store the output of the powershell command in a variable, ...
by ShadowThief
06 Dec 2022 17:26
Forum: DOS Batch Forum
Topic: Putting code output into a variable for string matching
Replies: 4
Views: 4589

Re: Putting code output into a variable for string matching

It's much easier to read the code when it isn't all on one line. @( Set/P "=The color is currently set to "<NUL For /F %%# In (' ^""%__AppDir__%WindowsPowerShell\v1.0\powershell.exe" -NoP "$Console=(Get-Host).UI.RawUI; Switch($Console.BackgroundColor,$Console.ForegroundColor){ 'Black'{'0'} 'DarkBlue...
by ShadowThief
05 Dec 2022 13:07
Forum: DOS Batch Forum
Topic: copy
Replies: 12
Views: 6630

Re: copy

miskox wrote:
05 Dec 2022 04:53
%0 returns batch name.

Code: Select all

@echo %0
Saso

P.S. Use code tags, please.
%0 returns the entirety of what was typed when the script was called. Presumably they're looking for %~n0.
by ShadowThief
14 Nov 2022 09:13
Forum: DOS Batch Forum
Topic: What is the magic code ?
Replies: 2
Views: 2172

Re: What is the magic code ?

User Data contains a space, so you need to wrap the path in quotes.

Code: Select all

copy "C:\Users\Joe\AppData\Local\Google\Chrome\User Data\Default\bookmarks" C:\Data\Chrome
by ShadowThief
09 Nov 2022 20:19
Forum: DOS Batch Forum
Topic: Timeout via for loop
Replies: 15
Views: 10337

Re: Timeout via for loop

Did you only want the "BERR_OUT_OF_SYSTEM_MEMORY" bit instead of the full line?
by ShadowThief
06 Nov 2022 02:08
Forum: DOS Batch Forum
Topic: Passing arguments to a subroutine
Replies: 4
Views: 4075

Re: Passing arguments to a subroutine

"It does not work" doesn't really give us enough information. What error message are you getting? Right now, my best guess is that because you pass %%G with quotes surrounding it and then you reference "%3" in the subroutine, you're doubling up the quotes, which is breaking things. Either get rid of...
by ShadowThief
03 Nov 2022 10:57
Forum: DOS Batch Forum
Topic: The ULTIMATE Command Line Utility
Replies: 5
Views: 3062

Re: The ULTIMATE Command Line Utility

Interfacist accelerates the command line with a preset system, Database connectivity and other features. For example you could iterate and run a command line process over every record in a CSV file or Database query result in a single click. You can inject named variables into any script language (...