I want to be able to open cmd and the do :cd project and this will put be in this directory>
C:\Users\USER\AppData\Local\Programs\Python\Python310\Projects\Random_shi\NWT
I know its possible because I saw someone in a youtube video do it once but I couldn't find anything online.
Any help would be appreciated.
Thank you
Using a DOSKEY shortcut works great
doskey shortcut=cd /d PATH
replace shortcut with whatever you want to use to navigate to your folder and PATH with the path to your directory
Example
doskey NWT=cd /d C:\Users\USER\AppData\Local\Programs\Python\Python310\Projects\Random_shi\NWT
Then all you have to do is call
C:\Users\USER>NWT
Related
I have a simple batch file which adds registry with reg add command.
reg add "HKLM\SOFTWARE\test\test" /f /v "MainDir" /t REG_SZ /d "test"
When I run the bach from a network drive everithing looks fine but no registry was added. When I copy the batch to to my desktop and run it it works perfectly.
I tried to use PUSHD but wont help, only thing what works is creating a shortcut and in the shortcut add %TEMP% to start in
I solved it. It was so unexpected. The problem was the Commander which I alway use in windows. Everytime I run the batch from commander it don't work, when I run it from explorer or something else it was ok. Soooo weird. The commander have admin right so I don't know why it dont work. Thanks all for help. :)
When I try to delete folder shortcuts from command prompt it deletes the target folder contents.
Can anyone help me to find another way to just delete shortcut?
Thanks to Christian K. I found the answer:
First I created a .lnk file (shortcut) with mklink but when I used del or erase to delete shortcut target file contents deleted. So now we can use rmdir to remove just shortcut.
I'm trying to make a CMD script that will do CD Desktop\Crunchyroll\pyscripts and enter it, then I want to be able to type a command. Is there a way I can make a script to start in the Desktop\Crunchyroll\pyscripts directory on my computer?
Put this into a blank text file called MyScript.CMD
Double click it.
#echo off
CMD /K CD /D "%userprofile%\Desktop\Crunchyroll\pyscripts"
To create a symbolic link on Windows, open Command Prompt (as an Administrator). Let's say your username is Jason. And the symlink we will name 'code'.
cd \Users\Jason
mklink /D code Desktop\Crunchyroll\pyscripts
cd code
dir
All your files in pyscripts will be listed. You basically have created a shortcut to your pyscripts.
Personally, I'd simply create a shortcut to cmd.exe and set Properties/shortcut/Startin to Desktop\Crunchyroll\pyscripts.
If you really want to jump to pyscripts from within an existing cmd instance, then create a textfile named 'pyscripts.bat' containing
#echo off
CD "%userprofile%\Desktop\Crunchyroll\pyscripts"
and store it somewhere in your PATH.
Then executing pyscripts from within a cmd instance will jump to the indicated directory and
....
PUSHD
call pyscripts
{do some python}
POPD
...
should allow you to execute python from that directory within a batch file.
Im trying to create a symbolic link to a text file with directory:
C:\users\me\textfile.txt
where the shortcut is in the same folder (for simplicity)
using command:
mklink /d "C:\users\me\textfileshortcut.lnk" "C:\users\me\textfile.txt"
but this just creates a folder with the name textfileshortcut.lnk and not a shortcut to a file.
What am i doing wrong?
I dont have too much experience with command line but i need it for this one task.
Create the symlink for a file using the below cmd command.
mklink "C:\users\me\textfileshortcut.lnk" "C:\users\me\textfile.txt"
/d or /D will create the directory symlink.
i use on command line on windows and write this.
mklink /D programName c:\program files\my app\program.exe
but i did not set any icon to my shortcut.
how do i do this?
mklink creates a link, not a shortcut.
If you want to create a shortcut from a batch file, you have several options, see creating a shortcut for a exe from a batch file
no, i found xxmklink.exe program after that. I am sorry.
http://www.xxcopy.com/xxcopy38.htm
this is my choice.