Running batch file on parallels vm with command issued from host mac - selenium

I am trying to start a selenium grid node on a local vm (running Windows 7) by using a call from the command line on the host Mac.
The call merely tries to run a batch file on the vm.
When I run the batch file from within the vm, it executes correctly and the node starts, so I know that batch file works correctly.
The path I am using is correct, as I can run it from anywhere on the vm.
It is just that I can't seem to call it from the host Mac.
This worked at one point, but I wonder whether a windows security update might have screwed things up?
I've tried to clear every firewall I could find. I am running parallels 8 on a MacBook Air.
Here is the syntax I am using.
prlctl exec {parallels_vm_name} 'C:\Users\{user_name}\Documents\selenium\startIeNode.bat {IP_address_here}'

The quotes around your
'C:\Users\{user_name}\Documents\selenium\startIeNode.bat {IP_address_here}'
should end at after .bat.
The only reason for those quotes is for the path, not for the command itself. It should look more like:
'C:\Users\{user_name}\Documents\selenium\startIeNode.bat' {IP_address_here}
Otherwise the IP address is being set as part of the pathname instead of a parameter.

I have almost the same setup/use case that you describe: Win 7 VM on Parallels 8. I just set my system up to do exactly what you want.
create .bat file verify it works on VM
create windows shortcut to batch file
drag shortcut onto Mac desktop, folder, Dock etc.
launch batch file from Mac shortcut
In coherence mode, VM settings to enable launching Windows Apps from Mac enabled, Parallel tools installed

Because of the way things are passed in prlctl exec, commands need to be executed double-slashed, so it would be:
prlctl exec {parallels_vm_name} "C:\\Scripts\\myScript.cmd"

Related

Get DISPLAY environment variable from a local terminal to the Visual Studio Code terminal through SSH

I'm using VScode with Windows Subsystem for Linux (WSL) and working through an SSH connection.
Unfortunately, the Remote - SSH extension by Microsoft doesn't enable X11 forwarding (#267), and thus an extension such as Remote X11 has been created.
Sadly, this extension doesn't work for me as I'm working through a jump host/gateway, and therefore have to manually change the DISPLAY variable in the VScode terminal to the DISPLAY variable found in another terminal that is used for displaying stuff.
I guess it is possible to get the DISPLAY variable by running tr '\0' '\n' < /proc/<pid>/environ | grep DISPLAY(Environment variables of a running process on Unix?), with the <pid> being run from the local terminal, and now it's just a problem of automating the search for this process.
So i guess the stuff I'm asking for, is a way to:
Get the pid from a process on a local terminal
Get the DISPLAY variable from this process
Set the DISPLAY variable in every newly opened terminal in VScode (perhaps running step 2 in the workspace-settings.json)
PS. I'm using the VcXsrv X Server

how to start Leingen with java -Djavax.net.debug=true option?

I am trying to diagnose a few issues with ssl connectivity with Leingen. I am trying to find what SSL Key Store and Trust Store is being Used by Leingen,
I am behind a corporate firewall and we have self signed certificates deployed on all our desktops . I am running lein.bat on a windows 10.
Hence I have to start Leingen with java -Djavax.net.debug=true option.
The :jvm-opts in the project.clj wont work -- I need to make sure the Liengen's JVM is started with this option
You can set leiningen JVM options by setting LEIN_JVM_OPTS environment variable before running lein in the same terminal session.
The lein command is just a shell script which eventually invokes java with various options. You can edit this script to see what options are used and/or to modify them.
As Piotrek mentioned, the LEIN_JVM_OPTS environment variable is the canonical way of passing options to the jvm in which lein runs. You can see it used on line 372 of the source code.
For your case:
> export LEIN_JVM_OPTS='-Djavax.net.debug=true'
> lein clean
> lein run
Since you're running windows, you'll want to actually look at the lein.bat file. You'll still need to update LEIN_JVM_OPTS, but how you go about it will be a bit different. If you're using windows command terminal (cmd.exe) you will want to use the set command.
set LEIN_JVM_OPTS="-Djavax.net.debug=true"
The command is likely different if you're using powershell, and you can likely find out how to set that on this page on environment variables.

Vmware web development kit

I am using Virtual Disk Management Kit v5.0 link.
The command i am using is
C:\Program Files\VMware\VMware Virtual Disk Development Kit\bin>vmware-mount I:
C:\Users\Rushil\Documents\Virtual Machines\Ubuntu\Ubuntu-s001.vmdk
Unfortunately the above command does nothing except that every time i run it a (sort of) vmware-mount man page is displayed on the command prompt telling about other command options. Any solutions ???
You have a space in your path to the vmdk and surely need to quote it:
vmware-mount I: "C:\Users\Rushil\Documents\Virtual Machines\Ubuntu\Ubuntu-s001.vmdk"

cmd.exe will not recognize command

I have a vb.net application that runs cmd.exe as the following:
Dim Port1 = CreateObject("WScript.Shell")
Port1.Run("cmd.exe")
Port1.Sendkeys("telnet ip address")
Port1.Sendkeys("{Enter}")
System.Threading.Thread.Sleep(6000)
When the cmd runs the sendkeys a error shows
"'telnet' is not recognized as an internal or external command,
operable program or batch file."
I closed the cmd window, opened another cmd, and typed in the command with not problems.
I need cmd to run in the vb.net and not as a separate file.
Running the vb.net in Microsoft visual studio Ultimate 2013.
Update: Can anyone tell me why it is doing the same thing when i move the app to another computer and try to run it?
You have to enable telnet on the computer by going to start > control panel > programs and features > turn windows feature on or off > check telnet client or typing optionalfeatures in run and checking telnet client. The command should execute successfully after that.
Either Telnet is not installed on your computer (it's not installed by default on any modern Windows versions as far as I know), or it its installation directory not in the PATH environment variable.
Either add it's install directory to PATH, or specify the full path to telnet.exe in the arguments to cmd.exe.
CMD runs commands based off of System32 and .bat(batch) or .exe. You would have to create a .exe or a .bat and place it into System32 in order for the command to work.

How to run C .exe file in auto run by USB?

I have a c program(i.e .exe) , i want to execute that program through USB in auto run mode, when USB is on then file should run . I make it auto run file i.e autorun.inf .Inside auto run file the content is
[autorun] action=v1.exe open=v1.exe
but it is not working .
What operating system are you using? I thought auto run was disabled in windows 7. See : http://blogs.technet.com/b/srd/archive/2009/04/28/autorun-changes-in-windows-7.aspx
Read this if you are using win 7 AutoRun changes in Windows 7
more over this kind of activity is using by malware so try to avoid, otherwise you will loos your trust level.