Page 1 of 1

>nul, not a valid command

Posted: 01 Jul 2011 03:08
by Ed Dyreen

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...

Re: >nul, not a valid command

Posted: 01 Jul 2011 07:03
by dbenham
Why post the same question in two places :?:
The answer is here

Dave Benham