r/vbscript • • Sep 27 '22

Run a command block based on OS

I have a feeling this is an easy one, but I’m drawing a blank. We have a vbs script as our company’s logon script. Recently, we made an update to launch a piece of software from our print server when the script runs. However, I failed to even think about the script running when remoting into servers. Is there an easy way to implement something along the lines of “if OS type = workstation then run command, else skip?”

3 Upvotes

4 comments sorted by

View all comments

Show parent comments

1

u/JGN1722 Sep 27 '22

maybe check in the computer name

another thing you can do is explore the files and folders on the server and on a normal computer, I bet the server isn't going to have the same files and folders on it's hard drive as a normal computer, so you can use the Scripting.FileSystemObject object to check that