Where I am at, it is not allowed to install any software. I need to automate some tasks and I cannot do it in powershell because it is not allowed. Are there any languages already installed on windows that i can use to automate and probably integrate with microsoft office?
- Batch, VBScript? Not sure about office thoughBali C– Bali C2012-01-05 17:15:44 +00:00Commented Jan 5, 2012 at 17:15
- 9Talk to your manager and get him to authorise Powershell. If you can't do your job because of the lack of tools - that's the real problem that needs addressing.ChrisF– ChrisF2012-01-05 17:16:08 +00:00Commented Jan 5, 2012 at 17:16
- 1Thou shalt not install external programs... you know, for security reasons. But thou shalt run on Windows. HmmmRHSeeger– RHSeeger2012-01-07 03:59:20 +00:00Commented Jan 7, 2012 at 3:59
- OP is not alone -..-Holene– Holene2015-12-15 13:27:23 +00:00Commented Dec 15, 2015 at 13:27
2 Answers
Yes, you can run VBScript and JScript through Windows Script Host. While using these languages, you can create objects to interact with Microsoft Office.
EDIT:
I've found the documentation for WSH fairly lacking, especially for JScript examples. Recently I wrote a script to print all files in a folder and subfolders, had to use JScript because my target machine was under similar restrictions to yours. Check out this gist for the source, it should give you a rough idea of how WSH scripts can work.
Beyond that, you can interact with Excel, for example, by calling CreateObject("Excel.Application") and using the returned object. I had to do this once, but that code belongs to a former employer and I can't remember the specifics beyond grabbing an Excel instance.