You are not logged in.
Pages: 1
Hello I am 100% new to command prompt so I am asking for a little guidance.
I am lost on part two I simply have no idea what it is asking, do you? I know the /K keeps the command prompt window open after the script is finished. But thats about it.
1· Create a new Windows shell initialization script that automatically adds to the path variable the name and path of the folder where you plan to store your Windows shell scripts.
the script bellow is saved in C:\scripts\PathMod.bat
**********************
@ECHO off
PATH C:\scripts;%path%
***********************
2· Create a new Command Prompt shortcut and configure it to automatically execute your new Windows shell initialization script. Hint: Use the /K switch and specify the complete path of the folder where the scripts reside.
I know I can create a short cut for the command prompt and have it start in C:\scripts but I have no idea how to use the /k switch to execute the shell initialization script.
From what I understand the \k simply keeps the window open after the script is executed. Other than that I am lost can some one please help me understand this better.
Offline
I think I have figured out how to do it by modifying the short cut's target: C:\Windows\System32\cmd.exe cmd /K C:\Scripts\PathMod.bat
I am not sure it is correctly done but it works.
I added the cmd /K C:\Scripts\PathMod.bat to the target.
Offline
Here's a way to use it in a batch file. %comspec% is a variable that holds the path and name of the cmd processor.
@echo off
"%comspec%" /k "c:\scripts\pathmod.bat"
Offline
Pages: 1