>nul, not a valid command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

>nul, not a valid command

#1 Post by Ed Dyreen » 01 Jul 2011 03:08


What's wrong here :x

Code: Select all

set "@Debug.on=set "@DNul=""
set "@Debug.off=set "@DNul=^>nul""
set "@TraceIn=call %%@DNul%% echo.hello world"

%@Debug.on%
%@TraceIn%
%@Debug.off%
%@TraceIn%
output:

Code: Select all

>nul wordt niet herkend als een interne
of externe opdracht, programma of batchbestand.
Meaning, not a valid command. Think I'm going crazy :(

This seems to work but it isn't good enough, the '>' really needs to be inside @DNul.

Code: Select all

set "@Debug.on=set @DNul=con"
set "@Debug.off=set @DNul=nul"
set "@TraceIn=echo.hello >!@DNul!"
setlocal enabledelayedexpansion
I've tried everything I can think of, I'm running out of ideas...

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: >nul, not a valid command

#2 Post by dbenham » 01 Jul 2011 07:03

Why post the same question in two places :?:
The answer is here

Dave Benham

Post Reply