why is this FOR doing this?
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: why is this FOR doing this?
Use start cmd /k cd /d C:\
Re: why is this FOR doing this?
orange_batch wrote:Use start cmd /k cd /d C:\
or click an icon.
The point is I want something efficient like start..run..cmd<ENTER> is efficient.
like start..run..cmd1<ENTER> with one process would be nice.
your one is just not efficient to get the cmd window up from start..run, it's too many keystrokes.
Re: why is this FOR doing this?
As I suggested before you could create a file "cmd1.bat".
Since Start->Run is searching in the path-environment you have to save it in one of the folders which are listed in %path%.
Instead of saving it into say C:\Widows I would prefer to create a folder (e.g. C:\myTools) and place the batch there. Now append this folder permanently to the %path% environment variable:
- Start->Run->SystemPropertiesAdvanced.exe
- click on Environment Variables, find "PATH" in the System Variables and double click it
- the Edit window opens, add "C:\myTools" separated by a semi colon (do NOT delete or change the other folders in this variable!)
Now you can run the batch via Start->Run->cmd1
Regards
aGerman
Code: Select all
@cmd /k cd C:\
Since Start->Run is searching in the path-environment you have to save it in one of the folders which are listed in %path%.
Instead of saving it into say C:\Widows I would prefer to create a folder (e.g. C:\myTools) and place the batch there. Now append this folder permanently to the %path% environment variable:
- Start->Run->SystemPropertiesAdvanced.exe
- click on Environment Variables, find "PATH" in the System Variables and double click it
- the Edit window opens, add "C:\myTools" separated by a semi colon (do NOT delete or change the other folders in this variable!)
Now you can run the batch via Start->Run->cmd1
Regards
aGerman
Re: why is this FOR doing this?
@agerman
I know about the path and can run cmd1.bat efficiently. start..run..cmd1<ENTER>
The issue is it creates 2 processes. See task manager
I know about the path and can run cmd1.bat efficiently. start..run..cmd1<ENTER>
The issue is it creates 2 processes. See task manager
Re: why is this FOR doing this?
taripo wrote:The issue is it creates 2 processes. See task manager
So what
Do you fear one cmd process more or less would influence the speed of your machine? Did you check the CPU-use of these processes? Perhaps it steals a bit of RAM space ...
Regards
aGerman
Re: why is this FOR doing this?
it's a bit messy. but fair point..
4 cmd windows would be 8 cmd processes listed in task manager in the processes tab.
though I suppose it's not so bad..
I can close quite clearly in the applications tab(and there i see the title too)..and they don't double there. And Chrome(which I may/may not use), takes up lots of processes. and lots of notepad windows is messy too. I suppose lots of cmd windows each with 2 processes is twice as messy as it'd be with one process, but perhaps not too bad.
4 cmd windows would be 8 cmd processes listed in task manager in the processes tab.
though I suppose it's not so bad..
I can close quite clearly in the applications tab(and there i see the title too)..and they don't double there. And Chrome(which I may/may not use), takes up lots of processes. and lots of notepad windows is messy too. I suppose lots of cmd windows each with 2 processes is twice as messy as it'd be with one process, but perhaps not too bad.
Re: why is this FOR doing this?
Well, orange_batch already gave you the hint how to solve it if the double cmd is bugging you. To avoid that it opens a new window use START /B.
cmd1.bat
Regards
aGerman
cmd1.bat
Code: Select all
@start /b cmd /k cd /d C:\
Regards
aGerman
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: why is this FOR doing this?
Yes, that is what I was talking about.
start will create the new cmd instance separately, which allows the first instance to reach the end (and exit) if loaded by a batch file.
Simply figure what works best for you.
taripo wrote:I said it makes 2 processes, I want it to make just one.
orange_batch wrote:Use start cmd /k cd /d C:\
start will create the new cmd instance separately, which allows the first instance to reach the end (and exit) if loaded by a batch file.
Simply figure what works best for you.