Hi,
I am having a very strange issue performing remote commands in some computers, from a vbs script.
The remote machine has a vbs script in C:\Scripts called generatefile.vbs. That script makes some things and generates a file.
From my pc, I execute a vbs scripts which, connects to the WMI service of the remote machine passing my credentials as user with administrator rights, creates an objProcess with the Create method of the Win32_Process class, and execute the command cscript C:\Scripts\generatefile.vbs
The process finish with return code 8 (Unknown error in the object documentation, good information). I run the script again and again, and everytime I get the same 8 error code, and of course, the file is not generated, because the command is not executed.
The very strange thing is that, then, I log on to the remote machine via RDP with that same credentials, and, locally, I execute the command cscript C:\Scripts\generatefile.vbs. The script runs, and generate the file. I delete the file, close the RDP session,
run the script in my machine and.. voila: the 8 return code doesn't appear, the command executes correctly and the file is generated. Even more, after that, I run the same script with different credentials (another user with administrator rights), and again,
the 8 return code appears and the remote script does not execute
I can't imagine the reason why this occurs, and I don't have any idea about how to afford it.
Any idea?