VMware Horizon Community
inno
Contributor
Contributor

QuickPrep and Scripts

Hi

I'm running composer and linked clones. I want to be able to use a script when a new machine has been clond. I have a VBS script and a Bta-file on the parent image. This is the content of the BAT file:

echo off

cls

cscript c:\windows\addcomputer.vbs

I have attached a PIC from the pool configuration in Vmview Manager. The script doesn't run when a new machine is cloned.

When a new machine is ready, I can log on to it and run the BAT file. Then everything works fine.

Any suggestions?

0 Kudos
9 Replies
Bart_Verbruggen
Enthusiast
Enthusiast

You must use only the post synchronisation script.

Now here is the trick.

The post synchronosation script runs only the first line in your BAT file. Since the first line is Echo off, it will only run this.

To solve this, you can do the following:

- Put only your vbs into the bat file OR

- Create a second bat file that contains all your actions and run the second bat file from the first bat file. In the post synchronisation script, you use the first bat file.

Bart

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks! Bart
0 Kudos
inno
Contributor
Contributor

Hi

I have tried both of your sugestions, but my script still doesn't run. I have attached the files that I'm trying to get to work right now.

0 Kudos
admin
Immortal
Immortal

does the script resist in the virtual machine at C:\windows?

try to add somethin like: echo test >c:\test.txt to try if it is executed ....

Don't forget to award the points if this answer was helpful for you.

Blog:

http://communities.vmware.com/blogs/dommermuth |

0 Kudos
inno
Contributor
Contributor

Hmm, strange. When I do Echo test>c:\test.txt in my BAT file it executes. But When I want to run my VBS script from the BAT file it does not execute

0 Kudos
admin
Immortal
Immortal

Are you using cscript.exe to call it from the batch?

Sent with my BlackBerry

0 Kudos
inno
Contributor
Contributor

Yes

0 Kudos
admin
Immortal
Immortal

Please could you provide the complete path to the cscript.exe in the script ... c:\windows\....

Regards,

Christoph

Don't forget to award the points if this answer was helpful for you.

Blog:

http://communities.vmware.com/blogs/dommermuth |

0 Kudos
Bart_Verbruggen
Enthusiast
Enthusiast

In your addcomp2.bat, please try to put cscript.exe instead of cscript (without .exe) and test it?

Bart

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks! Bart
0 Kudos
charvoworld
Enthusiast
Enthusiast

hi,

I am using .bat file for Post synchronization script, i have added path C:\scripts\test.bat for Post synchronization script. script doesn't worked. but when i run script manually it is not working, if i run it as "run as a administrator" it works. what command will work for Post synchronization script "run as a administrator"

Believe,

Charvo Benjamin

0 Kudos