How to correct VS Code terminal pointing to wrong folder C:\Windows\System32\WindowsPowerShell\v1.0? - reactjs

I try to open a React project path in terminal window using VS Code's Open in Integrated Terminal (Ctrl+Shift+`), but it sets C:\Windows\System32\WindowsPowerShell\v1.0 as current directory and not the project directory.
It doesn't behave like that for other projects (folders & paths).
This happened after I moved the files to another folder on my PC.
Screen shot of VS Code context menu with menu item Open in Integrated Terminal and the TERMINAL window with Windows PowerShell output and the path set as current directory.

this is return to special characters in file name.
characters like [ , ] made this error on VS code. git bash and CMD run well with them but vs code not.im not certain this is a bug or not

Related

The term 'behave' is not recognized as the name of a cmdlet, function

I have Python 3.10.7 with the follwing packgaes installed using pip install in command line:
behave 1.2.6
selenium 4.4.3
These have also been added to the packagelist of the project using the project config in pycharm
Also behave is in the systme path as well along with python.
I am trying to use the behave command but I am getting the following error:
behave : The term 'behave' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ behave features\myfeaturefile.feature
Following is my project directory:
Following is my project in pycharm:
I need help in fixing this problem as I am new to this tool. Thanks
First check if you have behave and python in the path variables.
Check if you can execute the below command
C:\demo>behave -h
If this does not return a list of help commands associated with behave, this means that behave is not in the path variables
Alternatively, you can check it via cmd using the "PATH" command. This will show you all the entries in the system path
C:\demo>PATH
PATH=C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin...
If behave or python are not in the path variables, you can set them using
set PATH=%PATH%;c:\PATH_TO_BEHAVE
NOTE: Setting path using cmd is only valid till the time the cmd window is open. Once you close it, the path variable will be rest to original values.
Behave, along with a few other .exe files is sitting in the:
C:\Users\chauhany\AppData\Roaming\Python\Python310\Scripts
As per your instructions #Manish Agarwal, I added the C:\Users\chauhany\AppData\Roaming\Python to the PATH from the command line and re-started the machine. But it didn't help. I then moved the behave.exe from the above location to my python 3.10 directory which is sitting in C:\Program Files\Python310 and python is in the system path, and restarted my machine again.
I then deleted and recreated my project with the new feature file (same directory structure).
If I now run the same command, that is, features\myfeaturefile.feature from
C:\Users\chauhany\PycharmProjects\martechBehaveProject>
I get a FileNotFound error
So I went to the folder where the file is actually sitting that is:
C:\Users\chauhany\PycharmProjects\martechBehaveProject\features\steps> and then re-ran the command and it worked.
I was under the impression that if you have just one feature file you don't have to specify the actual feature file and it can be run from anywhere in your project i.e., from any location which certainly is not correct.

Application does not run from command prompt but runs with double click ERROR: WERC6F9.tmp.WERInternalMetadata.xml

I have a WPF application, when double click from it is location it runs - no problems.
When I trying to start the app from command prompt I get an error.
I need to run the app from command prompt (also using startup register)
Files that help describe the problem:
C:\Users\xxx\AppData\Local\Temp\WERC6F9.tmp.WERInternalMetadata.xml
C:\Users\xxx\AppData\Local\Temp\WERE6F8.tmp.appcompat.txt
C:\Users\xxx\AppData\Local\Temp\WERE718.tmp.mdmp
What could be the problem
I hope this can help you
This could be because of Path. When you Double click app the required files for the application will there at the current folder hence the application is able to find and load the files required. But if your executing it from different path other than app path, lets say
Your application is present in the location D:\Data\Example.exe.
And your executing the app from different location Say C:\Program files, now the app will start running from C:\Program files and it'll start searching required files at C:\Program files and some temp locations once it don't find there it'll throws exception
You can do like this
Write a Batch file.first change the current directory to application directory in this case say D:\Data or you can add your application path to path environment variable and use it
Then Invoke the exe
Save the this file and you call this file from where you want
I had the same issue.
I found out that it was due to me using Debug not Release while building my application. The Microsoft .dll-s in the redistributable is for release.

Creating Bat file from inno setup file

I have an inno setup code which works fine. Can anyone tell me how to make a bat file from an inno setup code so that a single click will initiate the installation set up.I have done that for java class files.Any help is appreciated.
There should be no need for a .bat file. Inno Setup creates a stand-alone executable (by default named Setup.exe) that you can simply double-click like any other Windows executable.
The executable it creates is nameable either by renaming the Setup.exe to a different name (YourAppSetup.exe, for instance) manually, or by using the OutputBaseName value in the [Setup] section. You can control where the setup executable is created by using the [Setup] section value OutputDir. Here's an example, from the CodeExample1.iss' sample provided in yourInno Setup` installation:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={code:MyConst}\My Program
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
InfoBeforeFile=Readme.txt
OutputDir=userdocs:Inno Setup Examples Output
This creates the default Setup.exe in the userdocs: (your My Documents folder), in a subfolder named Inno Setup Examples Output. To put it somewhere else, just change the OutputDir entry to a different location. For instance, to put it in a sub-directory of your source folder named Installer, just use
OutputDir=Installer
For more info, see the documentation, in the Setup Script Sections->[Setup] Section Directives branch.
To change the name from Setup.exe to something else, add a new entry:
OutputBaseName=MyAppSetup

File cannot be found when relative path is used

In my WPF caliburn.micro application, I use ComponentOne's C1DocumentViewer to display a report.
I created in the project a new Folder “Reports” and placed the .xml there. I show the report using C1DocumentViewer. When provide the absolute path to the .xml file, it works fine. But of course I need to use a relative path. So if I make it “../../MyProject/Reports/MyReport.xml”, it works on my machine when I run it in Visual Studio. But not when I publish it using ClickOnce, it just cannot find the file. Same thing if I use “/Reports/MyReport.xml” or “Reports/MyReport.xml”.
When I try to use “Reports/MyReport.xml” when I debug in Visual Studio, it is looking for the path “Reports/MyReport.xml” in bin/Debug of the main project of the solution.
Please help. Here is my code:
protected override void OnViewLoaded(object view)
{
base.OnViewLoaded(view);
var rpt = new C1.C1Report.C1Report();
rpt.Load(#"Reports/MyReport.xml", "Recent Files Information");
rpt.DataSource.RecordSource = "MyReportProc(1)";
rpt.Render();
Report = rpt.FixedDocumentSequence;
}
Just a guess. Your problem might be related to the working directory of your process.
When the process refers to a file using a simple file name or relative
path (as opposed to a file designated by a full path from a root
directory), the reference is interpreted relative to the current
working directory of the process.
Check it with Directory.GetCurrentDirectory() when you run your program in Visual Studio and also when you run it after publishing it with ClickOnce.

How to pass a file as command line argument in Netbeans

I have trying to work out with Netbeans for the last two days.
I am writing a scanner program that takes input of the scanner from a file token_list.java.
So How can we give this token_list.java as an argument to the Main file ( Scanner.java).
When I am doing it on the Unix system using command line argument all works fine and well. The problem comes when i am doing it on netbeans.
I have even tried giving the file name token_list.java as an argument in the run properties in the project. But then later i realized that the command line arguments for the run properties are for just giving the inputs rather than the file name.
Update : The command that I give in unix is
$java Scanner input.text
So What I am now trying to do in netbeans is right click on the scanner.java and run it.
But it then gives the error that no arguments have been passed. I am taking the file name in argv
There is a community contributed plugin named NbRunWithArgs https://github.com/tusharvjoshi/nbrunwithargs which will provide you "Run with Arguments" option when you run Java project or a single Java file.
You may want to use this plugin, more details are available on blog post here.
UPDATE (24 mar 2014) This plugin is now available in NetBeans Plugin Portal that means it can be installed from Plugins dialog box from the available plugins shown from community contributed plugins, in NetBeans IDE 8.0
In Netbeans, right-click on your Project name and click Properties
In the "Run", you can define, which class is the main-class, the working directory and arguments
After that, try to run the project, not the class itself !

Resources