Jump to content

Recommended Posts

Posted

Trying to run some commands as part of a login script to give me a dump of the version of Teamviewer installed on PCs.

 

Using WMIC to run a product get name, version and output to a txt file on a server.

 

This is what i've used:

 

/output:"\\server\files\%COMPUTERNAME%-programlist.txt" product where "name like %%Teamviewer%%'" get name,version

 

However it doesn't replace %computername% with the computer name.

 

If i do

ipconfig/all >> "\\server\files\%COMPUTERNAME%-ipconfig.txt"

then it saves it correctly.

 

But this doesn't work when i'm in WMIC.

 

Any help - much appreciated!

Posted

Solved this myself! But will leave it here for anyone that googles to find this!

 

instead of entering WMIC then running the command, if i do it all together, it outputs correctly:

 

WMIC /output:"\\server\files\%COMPUTERNAME%-programlist.txt" product where "name like %%Teamviewer%%'" get name,version

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...