How to transfer a file from Windows XP to a virtual machine inside vSphere 5.5? - vsphere

I have a file on my desktop that I need to put onto one of the virtual machines, however when I search for solutions on how to do this many say to download third party software to do it, or to use drag and drop through vSphere. The issue is I am on a restricted network and can't install additional software, and also don't have the drag an drop functionality in vSphere.
I have seen it done in the past using the command line and the IP address of the machine I want to send it to, along with the username and password, however I can't remember the syntax. Can anyone provide instruction on what to type into the terminal to do this?

Have you given the Copy-VMGuestFile cmdlet a look from PowerCLI?
http://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/Copy-VMGuestFile.html
If you're not a fan of PowerShell, there's a couple SDK options you could use with the vSphere Web Services API. Specifically, you're looking for the GuestFileManager object and the InitiateFileTransferToGuest method: http://pubs.vmware.com/vsphere-5-5/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.FileManager.html

Related

Is it possible to change the IP address and Device Name in Windows CE via CMD or Batch?

Ideally, I'd have a batch file on my desktop that I could click to quickly change these configurations, but the batch scripting tutorials I've been looking at don't seem to work for Windows CE. Anyone know how to do this?
I want to set a static IP, Subnet Mask, Default Gateway, and Device Name.
If you want an easy and fast way (as double clicking a bat) to change your network configuration, typically you'll need to write a tool.
The tool must:
change values in the registry for your network adapter; the registry entries are something like:
[HKEY_LOCAL_MACHINE\Comm\NETADAPTER\Parms\TcpIp]
"IpAddress"="192.168.0.100"
"DefaultGateway"="192.168.0.1"
"Subnetmask"="255.255.255.0"
ask the adapter to renew his address (you can use NDISConfig.exe to do this)
If you have an hive based registry (data in registry are stored permanently and will be there after a reboot) you can reboot the device to easily implement the second step.
Hope this is helpful

Mapping a network drive only when connected to a Domain

I have looked around a bit, and I haven't found a solution that exactly fits my needs. I have a Laptop that I use for work, and for personal use at home. At work, we are operating on a Domain, and have several Network Storage locations that I use often. So i decided that I want to Map these drives. However, I do not want to get popup messages nor see that these drives are disconnected when I am at home, and there is no connection to these servers. Is there a built in way to accomplish this task in windows 7, or am I going to need to resort to a start up script. If I need a script, how can I check to see if the computer is connected to a Domain, and then map drives based on that option. If a script is required, I would prefer to use a .bat file. Another route that would be achievable is doing this through group policy if someone can direct me as to how to push certain mapped drives to specific users.
Without more details, I believe if value of the Windows variable USERDOMAIN is equal to the value of COMPUTERNAME then your host is not in a domain
If %USERDOMAIN% <> %COMPUTERNAME% SET indomain="y"
Alternatively, you can 'hack' it by trying to do something like a DIR of a folder like WINDOWS on a computer that's part of the domain. If you get denied then you're not part of the domain.

Guidelines to follow when making your program Active Directory/Terminal Services compatible

Wondering if there's any guidelines that should be followed when writing an application that should work not only on a plain ol' non-networked computer but also on a computer/network that is setup with Active Directory (or some other directory service) and/or Terminal Services? Anything I should look out for, be aware of, etc?
Microsoft has renamed Terminal Services to 'Remote Desktop Services' so searching and looking around MSDN my not be as constructive using the old terminology.
I'd start having a look around Remote Desktop Services Programming Guidelines found here:
http://msdn.microsoft.com/en-us/library/aa383490(VS.85).aspx
On the AD site a starting point would be here:
[http://msdn.microsoft.com/en-us/library/ms682458(VS.85).aspx][2]
The most important things to be aware of:
On a Terminal Server users are not admins, they have no rights to:
Write in Program files folder
Register ActiveX controls
Write into (ini files) in Windows(\System32)
HKLM hive of the registry
Some other points:
- Certain API's like getting the Windows directory will return redirected results (in this case the windows subfolder of the homedrive) UNLESS you mark your executable as Terminal Server aware
- Your application must not rely on settings in HKCU that prevent startup when not present
- Multiple users might use your app concurrently so each user must be able to have their own settings (in HKCU)

Customizing Print to File in WIndows

I have a requirement where my client want to install a custom "Print to File" printer (apparently MS has an SDK for this?). They want to be able to install this as a kind of "application" so that if someone chooses to print to this printer, they have to answer a few questions, and the file gets "printed" to a path of our choosing. (we will then do some other things with the file such as rename it and SFTP it)
I have tried googling, looking for things such as "customize print to file" and I have found nothing. Does anyone have any experience with this and can give me a kick in the right direction?
EDIT: I would rather have a c# oriented solution but I am willing to take anything right now.
Edit 2: The idea is for this "custom print driver" is for a document imaging company to provide an easy method for their customers to store/archive documents. The idea, is that the customer, if they want to store/archive a document, they would print, from standard windows applications such as Word, Excell, Acrobat Reader, Web Pages, etc., to the "company X" printer driver. When doing so, the document would get "printed" to a file in a specific location that another application (which has a filewatcher service on it, which would rename it and send it to the SFTP server), knows to watch. The document that is printed to the file, should ideally also be able to come out on paper (AKA just like normal). When printing to the "Custom print driver", we also need to have a form filled in which would provide meta-tags for the archiving system, which would also be uploaded to the document imaging system.
I am not looking to recreate a printing application, nor am I looking to add "printing" into a custom application. This needs to work at the Windows level.
I have no problems with the SFTP, FileWatcher, Alchemy integration (the document archiving application) or the document renaming portion. It's the "custom print driver" that I am having issues with. This is all compounded by the fact that when installing the application, I need to automatically install the "custom print driver", and configure it during the install process. Essentially the solution needs to be installed as a printer available under "My Printers" and should be available for any type of document, Word, Excell, PDF, etc. Oh, and it needs to be availabe for XP, Vista, and Windows 7 . . . . :(
Thanks in advance for everyones help. I have a feeling that this one is going to be a doozy :(
Hah! I knew I'd seen at least one...
ActMask Virtual Printer Driver
Can't make a recommendation of any sort not having tried this particular toolkit - but it would appear to me to bear a strong resemblence to the sort of solution you're after.
What kind of customization you are talking about? Can't you use the .Net inbuilt one?

RDP connectivity/responsiveness test

I want to write an app to test whether a Windows machine is responding correctly to RDP (Remote Desktop) - i.e. to check if the machine not only allows the connection, but is also responding normally, and is not hung or otherwise responding abnormally.
Is there a library or utility that I can use to do this? My searches turned up full RDC clients, but I'm hoping there's something out there at least offers an API for testing. I would most like to use Java or a scripting language to do this, but I'm open to suggestions.
You can find some good answers in this question: Programmatically create and launch and RDP session (without gui)
Because RDP is a constantly evolving proprietary protocol, i'm guessing there isn't some simple open-source code you can take and use. This leaves us with two possible paths to follow:
Use Microsoft RDP ActiveX control (on Windows)
Launch mstsc.exe and send keyboard events to it (also on Windows, using your favorite language)
For the second option, I suggest AutoHotkey. It is perfect for automating windows programs and comes with a powerful library. It also has a strong comunity behind it so you can find lots of useful scripts on the internet. I use it to control winamp (like 'i hate this song! delete it and move to next')(well, technically 'move to the next song and delete the previous' because you can't delete the file while in use but you get the idea). If you choose this path, i can help you with the script.
Found this on Experts Exchange:
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10, Prompt => '', Port >= 3389);
if($t->open("computer.name.or.ip")) {
print "Connect successful\n";
}
else {
print "Could not connect\n";
}
The idea was to attempt a connection and if it can't connect within 'x' amount of seconds, assume it isn't going to work. Gets a bit more complicated if you're trying to see if a login for a specific user works or not, but this should at least get you started.
NOTE: As pointed out in the comments, the original solution left out the RDP port, so I included that in this...

Resources