Page 1 of 1
using cmd /foff in batch file
Posted: 17 Oct 2011 05:21
by aveit
Hi
I am trying to use 'cmd /foff' in a simple batch file but all it runs is this and nothing else after it.
Any ideas what im doing wrong?
Many thanks
Paul
Re: using cmd /foff in batch file
Posted: 17 Oct 2011 14:28
by trebor68
Here a example for the prompt:
Code: Select all
(echo Here text number 1.) & (cmd) & (echo Here text number 2.)
The same code for a batch file:
Code: Select all
@echo off
echo Here text number 1.
cmd
echo Here text number 2.
The first command will display a text.
The second command will run a new instance of CMD. Also possible with parameters.
Now you can input different commands.
Here a example: set game=game name
set game
You will see "game name"
Input the command EXIT
The third command will display the text.
set game
If you have change variable in the CMD command then you have lost this change.