Nead a script to run a DOS program

  • Thread starter Thread starter Academia
  • Start date Start date
A

Academia

I have a DOS program, Tiny.exe

I'd like to add a shortcut to the Start menu that opens a Command prompt
window containing text pointing to that program.

That is, when I click the shortcut I'd like a Command window to open showing

>C:Program Files\Tidy.exe


so I can then type the options and filename and then run Tidy

Can you give me a reference to a script that I can put in a file and so a
shortcut to it accomplishes the above?


Thanks for any help
 
"Academia" <academiaNOSPAM@a-znet.com> wrote in message
news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>I have a DOS program, Tiny.exe
>
> I'd like to add a shortcut to the Start menu that opens a Command prompt
> window containing text pointing to that program.
>
> That is, when I click the shortcut I'd like a Command window to open
> showing
>
>>C:Program Files\Tidy.exe

>
> so I can then type the options and filename and then run Tidy
>
> Can you give me a reference to a script that I can put in a file and so a
> shortcut to it accomplishes the above?
>
>
> Thanks for any help
>


Create a shortcut on your desktop to Tidy.exe, then specify
"c:\Program Files" as the "Start in" folder.
 
I don't want it to actually run Tidy when I click the shortcut, but rather
to open a Command window with the text "C:Program Files\Tidy.exe" in it so I
can add the filename that Tidy will work on, and then press Enter to run
Tidy.

thanks



"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>
> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>I have a DOS program, Tiny.exe
>>
>> I'd like to add a shortcut to the Start menu that opens a Command prompt
>> window containing text pointing to that program.
>>
>> That is, when I click the shortcut I'd like a Command window to open
>> showing
>>
>>>C:Program Files\Tidy.exe

>>
>> so I can then type the options and filename and then run Tidy
>>
>> Can you give me a reference to a script that I can put in a file and so a
>> shortcut to it accomplishes the above?
>>
>>
>> Thanks for any help
>>

>
> Create a shortcut on your desktop to Tidy.exe, then specify
> "c:\Program Files" as the "Start in" folder.
>
 
You could do this with a macro that generates key strokes
but a more robust way would be to invoke the batch file
below via a desktop shortcut:

@echo off
set Target=c:\Program Files

:Again
set /p name=Please enter a file name for the Tidy program:
if "%name%"=="" goto Exit
if exist "%Target%\%name%" goto Action
echo Cannot locate "%Target%\%name%".
echo.
goto again

:Action
cd /d "%Target%"
"%Target%\Tidy.exe" "%Target%\%name%"

:Exit
echo.
echo Press the Space Bar to close this window.
pause > nul


"Academia" <academiaNOSPAM@a-znet.com> wrote in message
news:%23yFvuvXTIHA.1164@TK2MSFTNGP02.phx.gbl...
>I don't want it to actually run Tidy when I click the shortcut, but rather
>to open a Command window with the text "C:Program Files\Tidy.exe" in it so
>I can add the filename that Tidy will work on, and then press Enter to run
>Tidy.
>
> thanks
>
>
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>>
>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>>I have a DOS program, Tiny.exe
>>>
>>> I'd like to add a shortcut to the Start menu that opens a Command prompt
>>> window containing text pointing to that program.
>>>
>>> That is, when I click the shortcut I'd like a Command window to open
>>> showing
>>>
>>>>C:Program Files\Tidy.exe
>>>
>>> so I can then type the options and filename and then run Tidy
>>>
>>> Can you give me a reference to a script that I can put in a file and so
>>> a shortcut to it accomplishes the above?
>>>
>>>
>>> Thanks for any help
>>>

>>
>> Create a shortcut on your desktop to Tidy.exe, then specify
>> "c:\Program Files" as the "Start in" folder.
>>

>
>
 
Academia wrote:
> I don't want it to actually run Tidy when I click the shortcut, but rather
> to open a Command window with the text "C:Program Files\Tidy.exe" in it so I
> can add the filename that Tidy will work on, and then press Enter to run
> Tidy.
>
> thanks
>
>
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>> I have a DOS program, Tiny.exe
>>>
>>> I'd like to add a shortcut to the Start menu that opens a Command prompt
>>> window containing text pointing to that program.
>>>
>>> That is, when I click the shortcut I'd like a Command window to open
>>> showing
>>>
>>>> C:Program Files\Tidy.exe
>>> so I can then type the options and filename and then run Tidy
>>>
>>> Can you give me a reference to a script that I can put in a file and so a
>>> shortcut to it accomplishes the above?
>>>
>>>
>>> Thanks for any help
>>>

>> Create a shortcut on your desktop to Tidy.exe, then specify
>> "c:\Program Files" as the "Start in" folder.


Try adding Tidy.exe (or Tiny.exe) to the Sendto folder. Then
right-click the file you want to edit(?) and click Send To, Tidy.exe or
place Tid(n)y.exe on the Desktop, and drag/drop the other file onto it.

Couldn't hurt to try these..

--
Joe =o)
 
Great
Not exactly what I wanted.
I changed the first set to:
set /p Target=enter the path to the files:
Didn't really know what I was doing but duplicated your second set and it
worked.
Tried to find documentation on "set" by searching Help for it but didn't
find it.
Are these commands documented someplace?
For example, don't know what "/p" does.

I was playing with a shortcut file with the target cmd or command, and the
folder the location of tidy. Like you approach much better.

What is the difference between command and cmd?


It appears that you took the time to write the code just to answer my query.
I really appreciate it
thanks





"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:%23UTEo6XTIHA.4476@TK2MSFTNGP06.phx.gbl...
> You could do this with a macro that generates key strokes
> but a more robust way would be to invoke the batch file
> below via a desktop shortcut:
>
> @echo off
> set Target=c:\Program Files
>
> :Again
> set /p name=Please enter a file name for the Tidy program:
> if "%name%"=="" goto Exit
> if exist "%Target%\%name%" goto Action
> echo Cannot locate "%Target%\%name%".
> echo.
> goto again
>
> :Action
> cd /d "%Target%"
> "%Target%\Tidy.exe" "%Target%\%name%"
>
> :Exit
> echo.
> echo Press the Space Bar to close this window.
> pause > nul
>
>
> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
> news:%23yFvuvXTIHA.1164@TK2MSFTNGP02.phx.gbl...
>>I don't want it to actually run Tidy when I click the shortcut, but rather
>>to open a Command window with the text "C:Program Files\Tidy.exe" in it so
>>I can add the filename that Tidy will work on, and then press Enter to run
>>Tidy.
>>
>> thanks
>>
>>
>>
>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>> news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>
>>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>>> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>>>I have a DOS program, Tiny.exe
>>>>
>>>> I'd like to add a shortcut to the Start menu that opens a Command
>>>> prompt window containing text pointing to that program.
>>>>
>>>> That is, when I click the shortcut I'd like a Command window to open
>>>> showing
>>>>
>>>>>C:Program Files\Tidy.exe
>>>>
>>>> so I can then type the options and filename and then run Tidy
>>>>
>>>> Can you give me a reference to a script that I can put in a file and so
>>>> a shortcut to it accomplishes the above?
>>>>
>>>>
>>>> Thanks for any help
>>>>
>>>
>>> Create a shortcut on your desktop to Tidy.exe, then specify
>>> "c:\Program Files" as the "Start in" folder.
>>>

>>
>>

>
>
 
That's an idea

thanks

"Elmo" <elmogeek@iglou.invalid> wrote in message
news:%233DBt8XTIHA.1168@TK2MSFTNGP02.phx.gbl...
> Academia wrote:
>> I don't want it to actually run Tidy when I click the shortcut, but
>> rather to open a Command window with the text "C:Program Files\Tidy.exe"
>> in it so I can add the filename that Tidy will work on, and then press
>> Enter to run Tidy.
>>
>> thanks
>>
>>
>>
>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>> news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>>> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>>> I have a DOS program, Tiny.exe
>>>>
>>>> I'd like to add a shortcut to the Start menu that opens a Command
>>>> prompt window containing text pointing to that program.
>>>>
>>>> That is, when I click the shortcut I'd like a Command window to open
>>>> showing
>>>>
>>>>> C:Program Files\Tidy.exe
>>>> so I can then type the options and filename and then run Tidy
>>>>
>>>> Can you give me a reference to a script that I can put in a file and so
>>>> a shortcut to it accomplishes the above?
>>>>
>>>>
>>>> Thanks for any help
>>>>
>>> Create a shortcut on your desktop to Tidy.exe, then specify
>>> "c:\Program Files" as the "Start in" folder.

>
> Try adding Tidy.exe (or Tiny.exe) to the Sendto folder. Then right-click
> the file you want to edit(?) and click Send To, Tidy.exe or place
> Tid(n)y.exe on the Desktop, and drag/drop the other file onto it.
>
> Couldn't hurt to try these..
>
> --
> Joe =o)
 
You can find help for just about all Command Prompt commands
by opening a Command Processor and typing
set /?
copy /?
cd /?

To open a Command Processor, you click Start / run / cmd {OK}.
Command.com is a legacy version of the Command Processor -
you should never use it. Use cmd.exe instead.


"Academia" <academiaNOSPAM@a-znet.com> wrote in message
news:Ol%23kgRYTIHA.5516@TK2MSFTNGP02.phx.gbl...
> Great
> Not exactly what I wanted.
> I changed the first set to:
> set /p Target=enter the path to the files:
> Didn't really know what I was doing but duplicated your second set and it
> worked.
> Tried to find documentation on "set" by searching Help for it but didn't
> find it.
> Are these commands documented someplace?
> For example, don't know what "/p" does.
>
> I was playing with a shortcut file with the target cmd or command, and the
> folder the location of tidy. Like you approach much better.
>
> What is the difference between command and cmd?
>
>
> It appears that you took the time to write the code just to answer my
> query.
> I really appreciate it
> thanks
>
>
>
>
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:%23UTEo6XTIHA.4476@TK2MSFTNGP06.phx.gbl...
>> You could do this with a macro that generates key strokes
>> but a more robust way would be to invoke the batch file
>> below via a desktop shortcut:
>>
>> @echo off
>> set Target=c:\Program Files
>>
>> :Again
>> set /p name=Please enter a file name for the Tidy program:
>> if "%name%"=="" goto Exit
>> if exist "%Target%\%name%" goto Action
>> echo Cannot locate "%Target%\%name%".
>> echo.
>> goto again
>>
>> :Action
>> cd /d "%Target%"
>> "%Target%\Tidy.exe" "%Target%\%name%"
>>
>> :Exit
>> echo.
>> echo Press the Space Bar to close this window.
>> pause > nul
>>
>>
>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>> news:%23yFvuvXTIHA.1164@TK2MSFTNGP02.phx.gbl...
>>>I don't want it to actually run Tidy when I click the shortcut, but
>>>rather to open a Command window with the text "C:Program Files\Tidy.exe"
>>>in it so I can add the filename that Tidy will work on, and then press
>>>Enter to run Tidy.
>>>
>>> thanks
>>>
>>>
>>>
>>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>>> news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>>
>>>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>>>> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>>>>I have a DOS program, Tiny.exe
>>>>>
>>>>> I'd like to add a shortcut to the Start menu that opens a Command
>>>>> prompt window containing text pointing to that program.
>>>>>
>>>>> That is, when I click the shortcut I'd like a Command window to open
>>>>> showing
>>>>>
>>>>>>C:Program Files\Tidy.exe
>>>>>
>>>>> so I can then type the options and filename and then run Tidy
>>>>>
>>>>> Can you give me a reference to a script that I can put in a file and
>>>>> so a shortcut to it accomplishes the above?
>>>>>
>>>>>
>>>>> Thanks for any help
>>>>>
>>>>
>>>> Create a shortcut on your desktop to Tidy.exe, then specify
>>>> "c:\Program Files" as the "Start in" folder.
>>>>
>>>
>>>

>>
>>

>
>
 
I was going to reply:
"But how do I know the names of the commands"
But tried "help" in the Command Processor and that gave all the names.

Thanks


"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:efLpKVYTIHA.748@TK2MSFTNGP04.phx.gbl...
> You can find help for just about all Command Prompt commands
> by opening a Command Processor and typing
> set /?
> copy /?
> cd /?
>
> To open a Command Processor, you click Start / run / cmd {OK}.
> Command.com is a legacy version of the Command Processor -
> you should never use it. Use cmd.exe instead.
>
>
> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
> news:Ol%23kgRYTIHA.5516@TK2MSFTNGP02.phx.gbl...
>> Great
>> Not exactly what I wanted.
>> I changed the first set to:
>> set /p Target=enter the path to the files:
>> Didn't really know what I was doing but duplicated your second set and it
>> worked.
>> Tried to find documentation on "set" by searching Help for it but didn't
>> find it.
>> Are these commands documented someplace?
>> For example, don't know what "/p" does.
>>
>> I was playing with a shortcut file with the target cmd or command, and
>> the folder the location of tidy. Like you approach much better.
>>
>> What is the difference between command and cmd?
>>
>>
>> It appears that you took the time to write the code just to answer my
>> query.
>> I really appreciate it
>> thanks
>>
>>
>>
>>
>>
>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>> news:%23UTEo6XTIHA.4476@TK2MSFTNGP06.phx.gbl...
>>> You could do this with a macro that generates key strokes
>>> but a more robust way would be to invoke the batch file
>>> below via a desktop shortcut:
>>>
>>> @echo off
>>> set Target=c:\Program Files
>>>
>>> :Again
>>> set /p name=Please enter a file name for the Tidy program:
>>> if "%name%"=="" goto Exit
>>> if exist "%Target%\%name%" goto Action
>>> echo Cannot locate "%Target%\%name%".
>>> echo.
>>> goto again
>>>
>>> :Action
>>> cd /d "%Target%"
>>> "%Target%\Tidy.exe" "%Target%\%name%"
>>>
>>> :Exit
>>> echo.
>>> echo Press the Space Bar to close this window.
>>> pause > nul
>>>
>>>
>>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>>> news:%23yFvuvXTIHA.1164@TK2MSFTNGP02.phx.gbl...
>>>>I don't want it to actually run Tidy when I click the shortcut, but
>>>>rather to open a Command window with the text "C:Program Files\Tidy.exe"
>>>>in it so I can add the filename that Tidy will work on, and then press
>>>>Enter to run Tidy.
>>>>
>>>> thanks
>>>>
>>>>
>>>>
>>>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>>>> news:uuBginXTIHA.5208@TK2MSFTNGP04.phx.gbl...
>>>>>
>>>>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>>>>> news:OCW8paXTIHA.5980@TK2MSFTNGP04.phx.gbl...
>>>>>>I have a DOS program, Tiny.exe
>>>>>>
>>>>>> I'd like to add a shortcut to the Start menu that opens a Command
>>>>>> prompt window containing text pointing to that program.
>>>>>>
>>>>>> That is, when I click the shortcut I'd like a Command window to open
>>>>>> showing
>>>>>>
>>>>>>>C:Program Files\Tidy.exe
>>>>>>
>>>>>> so I can then type the options and filename and then run Tidy
>>>>>>
>>>>>> Can you give me a reference to a script that I can put in a file and
>>>>>> so a shortcut to it accomplishes the above?
>>>>>>
>>>>>>
>>>>>> Thanks for any help
>>>>>>
>>>>>
>>>>> Create a shortcut on your desktop to Tidy.exe, then specify
>>>>> "c:\Program Files" as the "Start in" folder.
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>
 
I want to loop, as shown below, until the use
inputs "" for the name but I can't find a way to
set name to "".

I've tried :
set %name%=""




"set /p Target=Enter the path to the files:

:Again
set /p name=Enter a file name:
if "%name%"=="" goto Exit
if exist "%Target%\%name%" goto Action
echo Cannot locate "%Target%\%name%".
echo.
goto again

:Action
rem cd /d "%Target%"
Tidy.exe -miu "%Target%\%name%"
echo %name%
set name=""
echo %name%
goto again

:Exit
echo.
echo Press the Space Bar to close this window.
pause > nul
 
Simple:

set name=


"Academia" <academiaNOSPAM@a-znet.com> wrote in message
news:OssEGYZTIHA.1208@TK2MSFTNGP05.phx.gbl...
>I want to loop, as shown below, until the use
> inputs "" for the name but I can't find a way to
> set name to "".
>
> I've tried :
> set %name%=""
>
>
>
>
> "set /p Target=Enter the path to the files:
>
> :Again
> set /p name=Enter a file name:
> if "%name%"=="" goto Exit
> if exist "%Target%\%name%" goto Action
> echo Cannot locate "%Target%\%name%".
> echo.
> goto again
>
> :Action
> rem cd /d "%Target%"
> Tidy.exe -miu "%Target%\%name%"
> echo %name%
> set name=""
> echo %name%
> goto again
>
> :Exit
> echo.
> echo Press the Space Bar to close this window.
> pause > nul
>
>
 
I thought I tried all combinations I could think of, with and without %.
Guess I missed that.

Thanks


"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:uxwwTXdTIHA.4272@TK2MSFTNGP06.phx.gbl...
> Simple:
>
> set name=
>
>
> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
> news:OssEGYZTIHA.1208@TK2MSFTNGP05.phx.gbl...
>>I want to loop, as shown below, until the use
>> inputs "" for the name but I can't find a way to
>> set name to "".
>>
>> I've tried :
>> set %name%=""
>>
>>
>>
>>
>> "set /p Target=Enter the path to the files:
>>
>> :Again
>> set /p name=Enter a file name:
>> if "%name%"=="" goto Exit
>> if exist "%Target%\%name%" goto Action
>> echo Cannot locate "%Target%\%name%".
>> echo.
>> goto again
>>
>> :Action
>> rem cd /d "%Target%"
>> Tidy.exe -miu "%Target%\%name%"
>> echo %name%
>> set name=""
>> echo %name%
>> goto again
>>
>> :Exit
>> echo.
>> echo Press the Space Bar to close this window.
>> pause > nul
>>
>>

>
>
 
You're learning quickly! By the way, your code
set name=
echo %name%
won't work well because the command "echo" followed
by nothing or by spaces will generate the reply
"echo is off"
A better way is to write
echo Name=%name%$
The $ at the end serves to show if %name% is empty
or if it consists of one or several spaces. Spaces are
extremely important in batch files - try this:
@echo off
set Name1=Academia
set Name2 =University
echo Name1=%Name%
echo Name2a=%Name2%
echo Name2b=%Name2 %


"Academia" <academiaNOSPAM@a-znet.com> wrote in message
news:e2LHLMhTIHA.4752@TK2MSFTNGP05.phx.gbl...
>I thought I tried all combinations I could think of, with and without %.
> Guess I missed that.
>
> Thanks
>
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:uxwwTXdTIHA.4272@TK2MSFTNGP06.phx.gbl...
>> Simple:
>>
>> set name=
>>
>>
>> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
>> news:OssEGYZTIHA.1208@TK2MSFTNGP05.phx.gbl...
>>>I want to loop, as shown below, until the use
>>> inputs "" for the name but I can't find a way to
>>> set name to "".
>>>
>>> I've tried :
>>> set %name%=""
>>>
>>>
>>>
>>>
>>> "set /p Target=Enter the path to the files:
>>>
>>> :Again
>>> set /p name=Enter a file name:
>>> if "%name%"=="" goto Exit
>>> if exist "%Target%\%name%" goto Action
>>> echo Cannot locate "%Target%\%name%".
>>> echo.
>>> goto again
>>>
>>> :Action
>>> rem cd /d "%Target%"
>>> Tidy.exe -miu "%Target%\%name%"
>>> echo %name%
>>> set name=""
>>> echo %name%
>>> goto again
>>>
>>> :Exit
>>> echo.
>>> echo Press the Space Bar to close this window.
>>> pause > nul
>>>
>>>

>>
>>

>
>
 
"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:ul$5EfiTIHA.5164@TK2MSFTNGP03.phx.gbl...
> You're learning quickly! By the way, your code
> set name=
> echo %name%
> won't work well because the command "echo" followed
> by nothing or by spaces will generate the reply
> "echo is off"
> A better way is to write
> echo Name=%name%$
> The $ at the end serves to show if %name% is empty
> or if it consists of one or several spaces. Spaces are
> extremely important in batch files - try this:
> @echo off
> set Name1=Academia
> set Name2 =University
> echo Name1=%Name%
> echo Name2a=%Name2%
> echo Name2b=%Name2 %


Shouldn't I see" "echo is off" for Name1 or Name1b
@echo off
set Name1=Academia
set Name2 =University
echo Name1=%Name%
echo Name2a=%Name2%
echo Name2b=%Name2 %
set Name=
echo Name1b=%Name%

output

Name1=
Name2a=
Name2b=University
Name1b=

thanks
 
"Academia" <academiaNOSPAM@a-znet.com> wrote in message
news:ucJx66iTIHA.1164@TK2MSFTNGP02.phx.gbl...
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:ul$5EfiTIHA.5164@TK2MSFTNGP03.phx.gbl...
>> You're learning quickly! By the way, your code
>> set name=
>> echo %name%
>> won't work well because the command "echo" followed
>> by nothing or by spaces will generate the reply
>> "echo is off"
>> A better way is to write
>> echo Name=%name%$
>> The $ at the end serves to show if %name% is empty
>> or if it consists of one or several spaces. Spaces are
>> extremely important in batch files - try this:
>> @echo off
>> set Name1=Academia
>> set Name2 =University
>> echo Name1=%Name%
>> echo Name2a=%Name2%
>> echo Name2b=%Name2 %

>
> Shouldn't I see" "echo is off" for Name1 or Name1b
> @echo off
> set Name1=Academia
> set Name2 =University
> echo Name1=%Name%
> echo Name2a=%Name2%
> echo Name2b=%Name2 %
> set Name=
> echo Name1b=%Name%
>
> output
>
> Name1=
> Name2a=
> Name2b=University
> Name1b=
>
> thanks


No, you should not because you're always outputting
the non-empty string "Name..=", regardless of the value
of the variable!
 
"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:e%23DtZ$iTIHA.2000@TK2MSFTNGP05.phx.gbl...
>
> "Academia" <academiaNOSPAM@a-znet.com> wrote in message
> news:ucJx66iTIHA.1164@TK2MSFTNGP02.phx.gbl...
>>
>> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
>> news:ul$5EfiTIHA.5164@TK2MSFTNGP03.phx.gbl...
>>> You're learning quickly! By the way, your code
>>> set name=
>>> echo %name%
>>> won't work well because the command "echo" followed
>>> by nothing or by spaces will generate the reply
>>> "echo is off"
>>> A better way is to write
>>> echo Name=%name%$
>>> The $ at the end serves to show if %name% is empty
>>> or if it consists of one or several spaces. Spaces are
>>> extremely important in batch files - try this:
>>> @echo off
>>> set Name1=Academia
>>> set Name2 =University
>>> echo Name1=%Name%
>>> echo Name2a=%Name2%
>>> echo Name2b=%Name2 %

>>
>> Shouldn't I see" "echo is off" for Name1 or Name1b
>> @echo off
>> set Name1=Academia
>> set Name2 =University
>> echo Name1=%Name%
>> echo Name2a=%Name2%
>> echo Name2b=%Name2 %
>> set Name=
>> echo Name1b=%Name%
>>
>> output
>>
>> Name1=
>> Name2a=
>> Name2b=University
>> Name1b=
>>
>> thanks

>
> No, you should not because you're always outputting
> the non-empty string "Name..=", regardless of the value
> of the variable!
>\


Duh!
Unbelievable the mistakes one can make when in unfamiliar territories

Thanks for staying with me on this
 
Back
Top