Skip to main content

Posts

Showing posts from October, 2014

Change password using command prompt automatically

Script below is a simple code snippet to change or reset a password in Windows using command line and does it automatically. It needs to be run using an elevated command prompt. Check out this link on how to open an elevated command prompt: http://quickbytesstuff.blogspot.sg/2014/10/open-elevated-command-prompt.html Or in a Windows server or a domain controller, if the account logon has administrative rights then just open a command prompt and run the code below. The script below can be called or run via a batch file script. Microsoft Knowledge base link below discusses on how to use the "net use" command line, to change the password of the user. Change password via command line: http://support.microsoft.com/kb/149427 But if there's a need to change the password automatically, then there is a need to tweak the command line and use some other scripting command to automate the process. Command line, batch file and VBScript are legacy tools, but still

PowerShell extract shared folder permissions

How to extract list of shared folders permissions? If the path of shared folder and its sub folders are not too long, it will be smooth and easy to get the security permissions. If the paths are quite long, then it will be a challenge. Robocopy.exe a command line tool, that is able to list folder and sub folders even the path are too long. Used the robocopy script from this link , to list all the files, folder and sub folders and save to a text file. But the robocopy output, will have a very detailed output that includes complete file names, the number of files on each folder and other details. To list the shared folder security permissions on PowerShell using the Get-Acl cmdlet; what is needed is just the path to the folder. So from the text file of robocopy output, need to extract the path directory for all the folders. Using the PowerShell script from this link   (http://powershell.com/cs/forums/t/12206.aspx): ===================== #from this link # http://power

Word VBA Get Content Control Value

How to check content control value of VBA check box? Below is a Word VBA code snippet on how to determine whether the check box is tick or not. A "for loop" statement and "select case" statement were used to get the value of the check box whether it is check or not. If check box is ticked or checked, it will return a true value. If the check box is not ticked or not checked, return value will be false. VBA code snippet is based on this scenario below; there are 10 check boxes in Word.  So to follow this example, you can create 10 check boxes and run the code below: Here's the simple VBA code snippet: ==================================== Sub checkbox_Check_if_Checked() Dim cBox As ContentControl Dim i, ix As Integer Dim checkBol As String ix = 0 For i = 1 To ActiveDocument.ContentControls.Count                 Select Case i         Case 1                         checkBol = ActiveDocument.ContentControls(1).Checked       

Pick a color in windows paintbrush

Paintbrush is a handy tool to edit or create simple graphics. How to pick a color using paintbrush? Paintbrush comes with a "color picker" tool to choose color from an image. The concept use in paintbrush is the same method use on other graphic software such as awesome freeware software like Paint.net and GIMP. So start using simple editing techniques with Windows Paintbrush, and same techniques will be used on other advance graphic tools. 1.        To start Paintbrush in Windows 7, type “pbrush” without quotes on the search box and click on “pbrush” from the search result. See image below: Another way of to open is to click on “All Programs”, click on “Accessories” then select “Paint” and click on it. See image below: “Color Picker” tool will come handy, if you have an existing picture or image and need to use the same color on other images or text; if color branding is quite important or if you just want to re-use the same color.

Open an elevated command prompt

How to open an elevated command prompt in Windows 7? To open an elevated command prompt in Windows 7; type "cmd" without quotes on the search box. And from the search result, select "cmd" right click on it. And on the pop up window select "Run as administrator". If you are logon without administrative rights, system will prompt for the username and password. Username and password are the credentials for the administrator account. If you're on a domain environment, you will have the option to specify the domain administrator account or the local administrator account. If you are using a home version of Windows 7, then you can only specify the local administrator account. See image below, on how to open an elevated command prompt. After clicking on "Run as administrator", it will open a command prompt window. And on the top left corner of the window "Administrator" account is displayed, to indicate that the comm

Export Task Scheduler Jobs in Windows

How to export Task Scheduler jobs in Windows? Windows has provided a graphical interface to export Task scheduler job. But the graphical interface allows exporting one selected job only. It does not allow exporting more than one. Which basically means importing of task scheduler jobs, can be done one by one only. See image below on how to export a task in Windows. Where to find Task Scheduler jobs? Tasks scheduler jobs can be found on c:\windows\system32\tasks folder.   To open a particular tasks just type notepad plus the filename. The command prompt should be open at an elevated mode. It will open the job and in XML format. See image below: If you have quite a few tasks running on a server or different servers which runs different tasks job. It's gonna be fun to do it manually and I guess Microsoft expect Windows System Administrator to have some fun once in a while.   It has to be done manually also, becaus