How can I set directory of Visual Studio Code's terminal?
When i edit a file with Visual Studio Code and open terminal (which is command prompt), the directory of terminal is "C:\Users\MyUser". How can i setup the VS Code configurations to make the directory be the current directory of the file that i'm editing?
You want the extension Terminal Here. It works very nicely.
See also questions close to this topic
Find previous searches in less command
In vim, if I am in search mode by pressing
/, I can press
pto find my last searched string, and press that combination again to find an even earlier searched string, and so on. I can do the same on commandline in emacs mode. I can't do the same with 'less' command. Can I do that? If yes, how? Thanks.
How on the stage of creating file in linux set uid and gid
The problem is that i am inside the docker container but I need create a file in some folder with different uid and gid parameters. Second I can't use chown and sudo commands. I need your help, please help.
Remove A Specific Sequence Of Characters From Text File Using The Terminal
I am trying to specifically only remove the last comma, new line, open parenthesis, new line, and close parenthesis from a text file using the terminal on macOS, but I can't seem to figure it out using the tr command.
The contents of the text file looks like:
EFD8FCFF, FD488AFF, FED6ECFF, FFA2A2FF, FFD7D8FF, ( )
VS Code file isn't saving locally, only seeing blue bars
VS Code file isn't saving locally, only seeing blue bars on the side panel, which i think has to do with which changes haven't yet been committed. I've tried saving and then compiling through terminal, but I don't get any changes in my print statements.
VSCode extensions: How do I open a new pane with an http url
In VSCode, is it possible to open a new pane pointing to an http url? I have a server running locally (on port 8080). I want to open it as a WebView. I couldn't find anything that provides this in the WebView API docs.
The functionality I'm looking for is similar to the snippet, except with the url opening in the VSCode editor iteself.
Workspace Complexity in Python Coding
When I add a folder in workspace, I easily run the script which is inside the folder. But... when there are another folder which I've already add to workspace, when I run that code, I faced some difficulty.
For example: I add a folder A in workspace. Inside folder A another folder is B. When I run a script which is inside folder B, it runs as it is in folder A. If I run only this code which is in the script inside folder B:
import os print(os.getcwd())
it shows the output that current directory is A which should be B.
How can I avoid such complexity.
./a.out results '.' is not recognized as an internal or external command, operable program or batch file
I am very new to c++ and using the command prompt.
I have multiple .cpp and .h files that run fine on my IDE (Code::blocks) running GNU GCC as the compiler. It displays what I need it too but when I try to use the command prompt and type "g++ file1.cpp file2.cpp ...." then "./a.out
I get the error "'.' is not recognized as an internal or external command, operable program or batch file." I have cygwin64 with the proper g++, cdb, make packages installed and the path setup.
what have I messed up?
fetching password expiration details via python script
i am new to python scripting, i am making a script to check password expiration details using python by calling net user cmd command, then copying and pasting the cmd output into the text file.i want to read that text file, extract just the password related details and then want to write password details in the new file. Also i am trying to get info if the user is admin or not using this code. code is:
import os import socket os.system(r'net user administrator > admin_access.txt') lines = open('admin_access.txt', 'r') f = lines.readlines() for y in f:`enter code here` print(y) lines.close()
SCHTASKS /QUERY /TN <foldername> contains spaces... results in an error
Got the following code.
SCHTASKS /QUERY /TN \Microsoft\Windows\!TaskName!\
This works fine when !TaskName! is a single word. However the command errors when !TaskName! contains spaces (for example '\Microsoft\Windows\Application Experience\').
ERROR: Invalid Argument/Option - ' Experience\'.
What am I doing wrong here?
EDIT: @Hans Passant Could you provide an example of the correct syntax? I tried
SCHTASKS /QUERY /TN "\Microsoft\Windows\Application Experience\"
SCHTASKS /QUERY /TN "\Microsoft\Windows\Application Experience"
But both return: ERROR: The system cannot find the path specified.
I've confirmed the directory exists in Task scheduler and that the directory path is identical to that contained in that utility.
NOTE: Interesting to add that:
schtasks /query /tn \microsoft\windows\wwansvc\
Works fine and enumerates tasks in the directory. However, if you place it in double quotes ("....") or omit the trailing or leading slashes ( ....) then it doesn't work.
FINAL EDIT: I found a solution...!
The following syntax is required when there are spaces in the directory-tree..:
schtasks /query /tn "\microsoft\windows\application experience"\
Note how the last backslash is outside the quotemarks.
P.S. Whoever gave me -1 your solution didn't answer the thread.