VMware Cloud Community
pratt26
Enthusiast
Enthusiast
Jump to solution

check for file in guest

Unless I am doing something wrong here, It looks like the built-in "Check file in guest" WF, only checks the local drives of the guest. Does anyone have code or a Scriptable Task that can check for a file on a Windows remote server (by UNC or after I map the drive) Thanks Dudes!:smileycool:

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
pratt26
Enthusiast
Enthusiast
Jump to solution

OK, Got this working by adding a second variable to the local drive. As an example

V:\\MYfile

D:\\Myfile

and calling the D:\\ variable when running the "check file in guest" works great!

View solution in original post

Reply
0 Kudos
4 Replies
jpsider
Expert
Expert
Jump to solution

‌interesting! When you map the drive do you then reference it by the drive letter?

you could drop a quick batch or powershell script on the box, and use that to search.

i Wouldn't expect a UNC path to work.

pratt26
Enthusiast
Enthusiast
Jump to solution

I map the drive with a scriptable task (i.e. NET USE V:) when I call the check for file in guest WF it ignores the V: (but can find the file fine on any of the local drives such as C or D) I was going to use the test-path cmdlet (my last resort) but was hoping there was some JavaScript or something someone had used previously.

Reply
0 Kudos
jpsider
Expert
Expert
Jump to solution

‌ah, ok, if you are using power lines, why not use the "invoke-script" cmdlet and write your own command to run in the guest?

you could just write a batch or powershell 1 liner to verify for a file or directory.

Invoke-VMScript - vSphere PowerCLI Cmdlets Reference

Reply
0 Kudos
pratt26
Enthusiast
Enthusiast
Jump to solution

OK, Got this working by adding a second variable to the local drive. As an example

V:\\MYfile

D:\\Myfile

and calling the D:\\ variable when running the "check file in guest" works great!

Reply
0 Kudos