I have been working on a simple little script to copy a file and then launch a program. I am sure that there are a lot of ways to do it, but I decided to use PowerShell, and this is what I came up with: $CheckForFile = "H:\custom.ini" $FileToCopy = "c:\IT\custom.ini" $CopyFileTo = "H:\" $PathTest… Continue reading Not recognized as a cmdlet…
Category: Scripting
PowerShell Confirm Preference
I seem to run into an issue when I run some PowerShell scripts where I get prompted at each line of the script for confirmation. That can get really annoying, so I have to look up how to prevent that behavior. Thankfully, there is already some good information out there on how to do that:… Continue reading PowerShell Confirm Preference
Servers in Domain
At some point, I had a desire to list all the computer accounts for any server OS in Active Directory. I am pretty sure that I did a search and found the script below, but I don’t remember where, so whoever wrote it doesn’t get credit this time… $strCategory = “computer” $strOperatingSystem = “Windows*Server*” $objDomain… Continue reading Servers in Domain
Using XML in your PowerShell scripting
I have written a lot of scripts that use .txt files to read or store data, but I have a need to read some information from an .xml file. This could be done by treating the file as a simple txt file, but it would require some pretty good filtering that is already a part… Continue reading Using XML in your PowerShell scripting
Monitoring drive space
One of the things that we spend a lot of time on is trying to keep track of what servers have enough free space. We have a lot of different tools to check drive space, and we even use some of them from time to time. We have a pretty complicated system created by Rickey… Continue reading Monitoring drive space
Another Registry Script…
I have the unfortunate need to occasionally fix things in the registry, mostly related to applications running in a Citrix environment. I believe there are nice tools out there that are supposed to do this for you, if given the right information, but I haven’t bothered to figure out what those tools are or how… Continue reading Another Registry Script…
Reading a Unicode text file using VB Script
I was looking for something else and came across this in the Scripting guy archives… Set objFile = objFSO.OpenTextFile(“c:\scripts\test.txt”, ForReading,False,TriStateTrue) The first two parameters probably don’t faze you much: they’re simply the full path to the file we want to open and the constant ForReading. And you’re right: this is standard operating procedure when it… Continue reading Reading a Unicode text file using VB Script
Unicode isn’t friendly to vbscript
I was trying to write a script to read a text file and evaluate the data to do some formatting on it. This is for a project I am working on and the person that gave me the text file wants some changes made based on the contents of the file. I have done similar… Continue reading Unicode isn’t friendly to vbscript
List All Folders in the User Profile Directory
I wanted to be able to remotely connect to a server and see if it had a profile directory for a particular user. I wrote a VBScript that will connect to a machine through WMI, find out what the ProfilesDirectory path is and then list all the folders in that directory. It wouldn’t take much… Continue reading List All Folders in the User Profile Directory
Deleting things from the Registry
So… the other day I was working on a script. I had a need to delete several registry Subkeys under one key. I hadn’t really figured out how I was going to go about it, but I happened to pick up a copy of TechNet Magazine on my desk and see at the bottom “Scripting… Continue reading Deleting things from the Registry