Search found 920 matches

by ShadowThief
14 Oct 2013 00:14
Forum: DOS Batch Forum
Topic: another output problem [solved]
Replies: 2
Views: 913

Re: another output problem

The variables aren't printing, right?

Change %color% to %%color%%
Change %computername% to %%computername%%
Change %seconds% to %%seconds%%
by ShadowThief
13 Oct 2013 13:17
Forum: DOS Batch Forum
Topic: [SOLVED]Switches and parameters for creating tasks
Replies: 19
Views: 6764

Re: How to pick which switches and parameters for creating t

Closest thing I can find would be to try calling the batch file with

Code: Select all

start /min
which MIGHT work, but I haven't tested it.
by ShadowThief
09 Oct 2013 22:20
Forum: DOS Batch Forum
Topic: Getting user input with a prompt
Replies: 2
Views: 975

Re: Creating a batch that sets time/date ahead 33 days possi

Code: Select all

set /p "c=Make your selection: "
by ShadowThief
09 Oct 2013 20:57
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 3534

Re: Automatically deleting oldest directories

An easier way would be that if it's only one folder, you can say

Code: Select all

cmd /c if not @path==C:\path\you\want\to\ignore rd /s /q @path
by ShadowThief
07 Oct 2013 17:04
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 3534

Re: Automatically deleting oldest directories

foxidrive wrote:
ShadowThief wrote:the "if @isdir==TRUE" is unnecessary because RD only deletes directories


You'll get an error for every file though.

But it won't affect anything. If it really bothers you, you can throw a 2>nul at the end
by ShadowThief
07 Oct 2013 12:50
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 3534

Re: Automatically deleting oldest directories

Endoro wrote:try this (make a backup before):

Code: Select all

@echo off
forfiles /p "G:\VERITAS\B2D"  /d -5 /c "cmd /c if @isdir==TRUE rd /s /q @path"

Also look at "forfiles /?" at the command prompt.

the "if @isdir==TRUE" is unnecessary because RD only deletes directories
by ShadowThief
07 Oct 2013 10:10
Forum: DOS Batch Forum
Topic: Automatically deleting oldest directories
Replies: 13
Views: 3534

Re: Automatically deleting oldest directories

instead of del @path you can use rd @path
by ShadowThief
27 Sep 2013 16:58
Forum: DOS Batch Forum
Topic: FTP - in one batch file?
Replies: 40
Views: 9148

Re: FTP - in one batch file?

test

Code: Select all

[color=red]test[/color]


Same BBcode, but the code tag prevents the color tag from being used.
by ShadowThief
27 Sep 2013 15:41
Forum: DOS Batch Forum
Topic: FTP - in one batch file?
Replies: 40
Views: 9148

Re: FTP - in one batch file?

Adrianvdh wrote:P.P.S WT FAQ? Why won't phpBB allow me to colour/color stuff?

because the code tag breaks formatting
by ShadowThief
17 Sep 2013 17:01
Forum: DOS Batch Forum
Topic: How to replace windows 7 system files ?
Replies: 5
Views: 1759

Re: How to replace windows 7 system files ?

Just out of curiosity, why ARE you replacing system files?
by ShadowThief
13 Sep 2013 22:12
Forum: DOS Batch Forum
Topic: stripping spaces from text file input
Replies: 7
Views: 2319

Re: stripping spaces from text file input

Removing every single space?

Change

Code: Select all

echo !string: ,=,!>>%tempfile%
to

Code: Select all

echo !string: =!>>%tempfile%
and you're done

EDIT: oops, left a comma in there by accident :-\
by ShadowThief
13 Sep 2013 21:39
Forum: DOS Batch Forum
Topic: stripping spaces from text file input
Replies: 7
Views: 2319

Re: stripping spaces from text file input

Since you have spaces in there that you want to keep, you first have to change the space-comma to just a comma, then you can split on commas. @echo off setlocal enabledelayedexpansion set inputfile=part_5.csv set tempfile=tempfile.txt :: Change the space-commas into commas for /f "tokens=* deli...
by ShadowThief
12 Sep 2013 20:03
Forum: DOS Batch Forum
Topic: Need help with batch program please
Replies: 5
Views: 1636

Re: Need help with batch program please

Does the file exist if you navigate to where it should be?
by ShadowThief
12 Sep 2013 20:02
Forum: DOS Batch Forum
Topic: How to replace windows 7 system files ?
Replies: 5
Views: 1759

Re: How to replace windows 7 system files ?

First of all, I would strongly advise against altering any system files unless you know what you're doing. Second, you should rename the old explorer.exe first and then move the new explorer.exe. Right now you're overwriting the old file and renaming the new file, which is not what you want to do. r...
by ShadowThief
10 Sep 2013 18:13
Forum: DOS Batch Forum
Topic: Batch file which pings and timestamps alongside
Replies: 6
Views: 11179

Re: Batch file which pings and timestamps alongside

It's an escape character. You need it so that the pipe is included in the thing the for loop is doing instead of everything after it being separate.