Difference between File Explorer (Windows EXplorer) and Run Command - windows

Is there any difference between File Explorer and Run command in Windows system while accessing the remote location path.
For EG: \\hostIP\folder1

I haven't used Windows for a long time (I'm just using Linux for everything) but from what I remember "Run" just opens File Explorer, so there shouldn't be any difference. But I may be wrong.

Related

Open Linux subsystem directory v.s. raw Windows directory in VS Code?

I want to open a WSL directory in VS Code. What's the difference between the following two methods and which should I use?
First method, open WSL window. It's common.
Second method, directly open directory and select the directory in wsl$ path.
Visual Studio Code recognize better the Connection than opening it directly
In most cases, you'll want to use the "New WSL Window" (or its equivalent). This utilizes the "Remote - WSL" extension to connect to your WSL instance through a small server that it installs in your WSL user's home directory. You'll probably find it already installed in your case in ~/.vscode-server.
This server handles the "translation" between the Windows VSCode and the Linux files, folders, and processes.
An easy way to think about the difference between the two methods of opening a folder:
Using "New WSL Window" puts VSCode in "WSL/Linux" mode
Using "Open Folder" and opening \\wsl$\... directly keeps VSCode in "Windows mode".
Comparing the two techniques with a real file. I have a simple Python file in my WSL home directory that I wrote up for another answer a few days ago. If I:
Open my home directory through \\wsl$\ in VSCode, then the VSCode Python extension complains:
Python is not installed. Please download and install Python before using the extension.
Since I don't have the Windows version of Python installed, and VSCode is operating in "Windows mode", it can't find the Linux/WSL Python interpreter.
However, if I:
Open my home directory through "Remote-WSL: New WSL Window", then open my Python file, then VSCode finds my Python interpreter, and I can run and debug the file in WSL through VSCode.
Side note #1: There is another method that has the same effect as using the command palette's "New WSL Window" -- From inside a WSL directory, run code .
Side note #2: There may be times when you want to open a file that lives inside WSL in "Windows mode". You may want to run it in a Windows version of a tool (Python, Java, whatever) to check compatibility.
As a general rule of thumb, however, you should probably do your Linux development with files inside WSL using VSCode's "WSL Mode" and Windows development with files that live on a Windows drive using "Windows (a.k.a. normal) mode".

Bash on Windows - debug a python file with Visual Code or Visual Studio

I have a python file in my Bash on Windows environment.
Is it possible to debug it with Visual Code or Visual Studio?
Can a debugger be attached to the Linux python version that exists in the Bash on Windows environment?
I think you've got a few options for this. If you're attempting to debug a python file that's saved on your home directory in Bash on Windows, you can navigate to your home directory in Windows by going to "C:\Users\[windows username]\AppData\Local\lxss\home\[ubuntu username]\". Then you can open any of your projects or files saved on your home folder in Ubuntu. You can even make a shortcut on your desktop or something to make it easier to access this folder.
However, if you need the environment that you have on Bash for dependencies or python modules, your other option is to install a GUI and Linux-compatible IDE of your preference on Ubuntu, and use Xming on Windows to run the IDE on your screen. A tutorial on how to do this can be found here.
If you need to debug a linux python program from Visual Studio, a simple Google search yielded this. I haven't tried it but this seems to be the solution you are looking for. For connecting over the network to Bash on Windows from Windows, use localhost for the host.
Your best bet might be to just move the file. Your normal windows system is mounted under /mnt/c.
You can just copy it to your desktop by doing
cp (path to your file) /mnt/c/(your username)/Desktop
When you need to access or edit it from bash, just cd to that location (or wherever else you choose to store it).
Interesting other idea: you could mount cloud storage (e.g. google drive) via fuse in linux then set it up in windows. Copy the python to it and you can edit in windows and access in linux as needed. (Google is your friend here; look into google-drive-ocamlfuse or gdrivefs).
Hope this helps!
jBit
I would suggest making use of the Remote - WSL extension for Visual Studio code. It allows you to easily access your Windows Subsystem for Linux (WSL) and use it as a full-time dev environment.
Here is an article on how to set up Visual Studio Code Remote-WSL.
After that is set up, you can quickly load your python file in the VS Code editor using a command like: code path/to/python_file.py

RCU.bat file not opening on virtual machine

I have installed a Windows 2008 Server on my VM. I am trying to run a .bat file (on my VM). This .bat file is stored on my local Windows 7 PC, and I'm using shared folders to access it.
The .bat file does not work on my virtual machine. There is no error shown. The command prompt window pops up and then goes away..
However this file works fine on my PC. What could be the reason for the file to run on one system and not run on the other?
How can I run this .bat using the command prompt of my virtual machine? To check if any error log shows up? What could be done? Please advise.
Thanks,
Are you double-clicking on the .bat file through windows explorer? Open the command prompt, then cd to where you have the file and just run it.
cmd cannot use UNC paths as the current path. I'm guessing your shared folders use a network share in the guest machine. Map that share to a drive letter and try again.

gvim does not recognize certain directories or files (Windows 7 64-bit)

I'm having a weird issue with gvim on Windows 7 64-bit. I am using gvim 7.2, and the "c:\windows\gvim.bat" is the executable that is first on my path if I just type "gvim" on the powershell command line. Note that I've tried both the gvim.bat file and calling gvim.exe directly.
For some reason, there is a certain directory on my file system which vim does not seem to see or recognize. I can navigate to this directory in cmd, powershell, windows explorer, etc., and I can see the files in the directory. I can also edit the files in notepad or another text editor, but if I try to open any of the files in gvim, it does not open the file, but rather reports "[New DIRECTORY]". If I try to open the folder itself in gvim, it does not open it in the vim directory browser as I would expect, but instead it reports "[New FILE]".
If I open gvim, and do File->Open... and navigate to where the folder should be, it is not visible in the open file dialog.
What would cause a directory (or files) to not be visible or recognized by gvim?
Note that the directory I'm having problems with is the PowerShellCommunityExtensions module. I currently have this installed here: "c:\windows\system32\WindowsPowerShell\v1.0\Modules\Pscx\". The Pscx folder is the one that gvim will not recognize. I have other modules in this Modules folder which gvim can open successfully.
Apparently GVIM.exe is a 32-bit app that appears to Windows 7 as a legacy app which causes Windows Vista/7 to virtualize access to the file system and registry. Access to C:\Windows\System32 is redirected to C:\Windows\SysWOW4. Writes to C:\Program Files are redirected to C:\ProgramData or C:\Users\\AppData\Local\VirtualStore. And access to the registry node HKLM:\Software is redirected to HKLM:\Software\Wow6432Node. The following MS Support URL explains it a bit further.

ActiveMQ install issue

I am running win7 professional 64-bit. I have already installed java, and am trying to install ActiveMQ. The install worked perfectly on a Windows Server 2003 machine but now it is giving me issues on my win7 machine. I download ActiveMQ 5.3.2 extract the files and then try to run the installservice.bat file as administrator and it gives me the following error in command prompt: '"wrapper.exe"' is not recognized as an internal or external command, operable program or batch file.
I had the same issue when using Windows Explorer and right clicking on the InstallService.bat file and selecting "Run As Administrator".
However, this worked for me (without having to change my user control settings):
1) Open a command prompt (right clicking first with "run as administrator").
2) Then navigate to the folder where your batch file is and simply type InstallService.bat.
Ok I feel a little stupid answering my own question but here it goes. Turn off the user control settings in the control panel
I had the same issue with apache-activemq-5.6.0 and solved it this way:
Open cmd.exe as admin (click on Start, type in cmd, right click on the "cmd" program, and choose Run as administrator)
In the cmd.exe window, navigate to your apache-activemq-5.X.X root dir (which contains bin, conf, data, docs, ...)
From there, navigate to bin\win64
Your commmand prompt should show something like:
...\apache-activemq-5.6.0\bin\win64>
Still in the cmd.exe, run InstellService.bat
It does not work if you run something like win64\InstellService.bat while being in bin. You have to actually navigate to bin\win64 first.
The in case you are installing in win 64 bit 2012 Server too, run InstallService.bat under sys32.
Its little confusing but it works.

Resources