Running a powershell command using full path and arguments from command line [duplicate]

As an aside: The quoting-related part of the problem could have been avoided by using environment variable $env:ProgramFiles instead of literal “C:\Program Files\…” in the script path, which would have simplified the command to: powershell “& $env:ProgramFiles\Folder\file.ps1 -verbose:$True -restart” Indeed, in order to execute scripts referenced by literal paths with embedded spaces in PowerShell, those … Read more

How to grant permission to users for a directory using command line in Windows?

As of Vista, cacls is deprecated. Here’s the first couple of help lines: C:\>cacls NOTE: Cacls is now deprecated, please use Icacls. Displays or modifies access control lists (ACLs) of files You should use icacls instead. This is how you grant John full control over D:\test folder and all its subfolders: C:\>icacls “D:\test” /grant John:(OI)(CI)F … Read more

How to run TestNG from command line

You need to have the testng.jar under classpath. try C:\projectfred> java -cp “path-tojar/testng.jar:path_to_yourtest_classes” org.testng.TestNG testng.xml Update: Under linux I ran this command and it would be some thing similar on Windows either test/bin# java -cp “.:../lib/*” org.testng.TestNG testng.xml Directory structure: /bin – All my test packages are under bin including testng.xml /src – All source … Read more

How to include jar files with java file and compile in command prompt

You can include your jar files in the “javac” command using the “-cp” option. javac -cp “.:/home/path/mail.jar:/home/path/servlet.jar;” MyJavaFile.java Instead of “-cp” you could also use “-classpath” javac -classpath “.:/home/path/mail.jar:/home/path/servlet.jar:” MyJavaFile.java You could including the jars every time you compile by setting the environment variable “CLASSPATH” correctly. The environment variable will store the path where the … Read more

Compiling/Executing a C# Source File in Command Prompt

CSC.exe is the CSharp compiler included in the .NET Framework and can be used to compile from the command prompt. The output can be an executable “.exe”, if you use “/target:exe”, or a DLL; If you use /target:library, CSC.exe is found in the .NET Framework directory, e.g. for .NET 3.5, c:\windows\Microsoft.NET\Framework\v3.5\. To run, first, open … Read more

‘git’ is not recognized as an internal or external command

Have you correctly set your PATH to point at your Git installation? You need to add the following paths to PATH: C:\Program Files\Git\bin\ C:\Program Files\Git\cmd\ And check that these paths are correct – you may have Git installed on a different drive, or under Program Files (x86). Correct the paths if necessary. Modifying PATH on … Read more