how-to

Dynamically Disable Shared Folders in VMware Workstation

Let me set the stage. You’re working with a Windows Virtual Machine and you want to install an application you suspect is, shall we say, malicious. So, you connect to the VM’s shared folders, copy the installation files locally and want to shut off folder sharing. This process takes more than 6 clicks every time you want to toggle this on and off!

As it turns out, there’s an easier way to do this and it can be done outside the VM with a quick shortcut. It’s done with the vmrune.exe command-line tool in Vmware Workstation’s install folder. You have to make sure that the target virtual machine is actually powered on.

Here’s what the command line looks like:

"c:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" -T ws disableSharedFolders "c:\VMs\VMName\ConfigFile.vmx"

You’ll notice that the operative command here is “disableSharedFolders,” and yes, the opposite is possible with

"c:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" -T ws enableSharedFolders "c:\VMs\VMName\ConfigFile.vmx"

For quick access to this, create a shortcut on the desktop and you’ll be able to disable those shared folders in just one double click or shortcut key.