Archive: Too Many Vars


Too Many Vars
I have tried finding the answer for this, but I'm not even sure what to look for. I have the following in a script, but when it runs, it errors sating too many vars. Any help would be greatly appreciated.

FileWrite$9'for/f"tokens=1"%%iIN('supportcompname/d?s')doif%%i==VMware-56setCOMPUTERNAME=VMWARE$\r$\n'

I know it's not PHP, but there is no code button.

Eddie

I can say that I've never seen that error before. But, I do see that there may be an issue with the quotes. Notice how you start the command with single quotes, but then when you get the 'supportcompname' command, you are trying to encase those in single quotes. I'm thinking that when it hits the 2nd single quote, it's trying to end the command there.

Assuming the quotes need to be written to the file, you might need to split this into 2 lines of code like this:


FileWrite $9 'for /f "tokens=1" %%i IN ('
FileWrite $9 "'supportcompname /d ?s') do if %%i==VMware-56 set COMPUTERNAME=VMWARE$\r$\n"

That did it!

Thanks you very much!