0

As mentioned in the title, I am currently creating an automized deployment of VMs using VMware PowerCLI. Everything works fine so far, until I want to execute some scripts in the GuiRunOnce section after the SysPrep customization. My goal is to copy some files from a network share to the newly created VM, but there I have the problem that the network share is not reachable. When I "leave" the GuiRunOnce part and the OS loads properly, the network share is reachable just fine with the same script which was run during the GuiRunOnce. Therefore I thought that some network related service might not be completely loaded yet and I tried to run "ipconfig /renew" to assure that the system has a valid IP, but this didn't help. I also thought that it could be due to DNS name resolution, so I manually started the dns client, with no success. It also seems that the share is not reachable when using the IP address, so I can't figure out the cause.

The guest system is a Windows XP SP3 with DHCP.

I use the following script to access a share and copy some files:

net use "\\192.168.1.2\Resources" password /user:domain\username,
copy /Y "\\192.168.1.2\Resources\file.ora" "C:\destination\file.ora"

Any ideas? Is there maybe an alternative how I can get this at a later stage? Waiting using a ping to 127.0.0.1 also doesn't help. Is there some other service that might not be loaded yet?

Please let me know of you require some more details.

Thanks in advance

Br vm370

ArgisIsland
  • 153
  • 1
  • 6

2 Answers2

0

try starting your lines in your script there with "cmd /c" as well as using two extra backslashes in the front of your IP address (and removing the quotes this time).

For instance:

"cmd /c net use X: \\\\192.168.1.2\Resources /user:domain\username password"

"cmd /c copy /Y X:\file.ora C:\destination\file.ora"

If that doesn't work, try it with only the normal \\ in front of the IP again.

TheCleaner
  • 32,627
  • 26
  • 132
  • 191
  • Thanks for your answer. I tried this too and it didn't work. However for the destination folder I think I have to use quotes since I have some cases where there is a blank space in the source path of the file. I also tried to outsource the commands into a script file and then execute it in the GuiRunOnce. There I saw that I get a "System error 67 has occured. The network name cannot be found." when using net use on the share. And as mentioned before, the script runs fine after the GuiRunOnce sequence is finished. So I don't think it's syntax related. – ArgisIsland Mar 28 '13 at 14:00
0

I have seemed to figure it out after googling around some more hours. The service "lanmanworkstation" was obviously not started yet, which seems to be responsible for connections to other systems, e.g. for network shares. After starting the service, I was able to access the share and copy the file(s). In addition to that, I needed to put the commands into a separate script, which was called in the GuiRunOnce:

[GuiRunOnce]
C:\customize.bat

customize.bat script:

net start "lanmanworkstation"
net start "w32time"
net use x: "\\192.168.1.2\Resources" password /user:domain\username,
copy /Y "x:\Resources\file.ora" "C:\destination\file.ora"
ArgisIsland
  • 153
  • 1
  • 6