Content Preview: rss
105 days ago
I see a lot of people asking about script editors for vbScript and Powershell. If you want free then I would suggest the following: Notepad Plus is a good replacement for Notepad. http://notepad-plus.sourceforge.net/uk/site.htm Here are the features of Notepad++ : Syntax Highlighting and Syntax Folding Supported languages : C C++ Java C# XML HTML PHP CSS makefile ASCII art (.nfo) doxygen ini file batch file Javascript ASP VB/VBS SQL Objective-C RC resource file Pascal Perl Python Lua TeX TCL Assembler Ruby Lisp Scheme Properties Diff Smalltalk Postscript VHDL Ada Caml AutoIt KiXtart Matlab Verilog Haskell InnoSetup CMake YAML WYSIWYG User Defined Syntax Highlighting Auto-completion Multi-Document Multi-View Regular Expression Search/Replace supported Full Drag ‘N' Drop supported Dynamic position of Views File Status Auto-detection Zoom in and zoom out Multi-Language environment supported ...
106 days ago
I ran across this article ( Open Command Window Here « Burgaud.com ) about adding the Open Command Line Here to the Right Click menu in Explorer. It’s a good article and it shows you how to do the job with some registry hacks. I have included my versions here: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\runas] @="Open Command Window Here" [HKEY_CLASSES_ROOT\Directory\shell\runas\command] @="cmd.exe /k pushd %L" [HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt] @="Open Command Window Here" [HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\command] @="cmd.exe /k pushd %L" [HKEY_CLASSES_ROOT\Drive\shell\CommandPrompt] @="Open Command Window Here" [HKEY_CLASSES_ROOT\Drive\shell\CommandPrompt\command] @="cmd.exe /k pushd %L" Just copy the above and save it to a regfile. I call mine open_cmd_here.reg Then open up explorer and double click the ...
106 days ago
First of all, PowerShell does not have an InStr() or Mid() function, at least version one does not. I was trying to extract the Group name from the Common Name in AD and I wanted everything between the first = sign and the first "," comma. (I know there are other ways) So I found that in Powershell you can get the first position of a character by using indexof() like so: $a=$path $b = $a.indexof("=") # so the first = is at character 9 I don't want the equal sign so I add 1 $b = $b + 1 Next I get the index of the first comma. $c = $a.indexof(",") Then I get the number of characters between $c and $b $d = $c - $b Finally I get the substring I wanted: substring starts at the first character, in this case $b and then includes the number of characters in your substring, in this case $d. $e = $a.substring($b,$d) And here is my MID function: Function MID($path) { ...
111 days ago
I was asked to make up a menu for some connection testing. Many of the machines that are being tested are Windows XP and many of the testers are using XP. I found that Net View works differently on XP than it does on Vista, So I had to come up with a way to determine if the C$ share was available on either XP or Vista machines and from either a Vista or XP machine. I attempt to map to the test machine's C$ share and record the results in a text file. I then read the file and pull out the error code. Here is the function: Function View(strComputer) On Error Resume Next Const OpenAsDefault = -2 Const FailIfNotExist = 0 Const ForReading = 1 Set oShell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") sTemp = oShell.ExpandEnvironmentStrings("%TEMP%") sTempFile = sTemp & "\runresult.tmp" oShell.Run "%comspec% /c net ...
114 days ago
Want to add a little color to your spreadsheets? This will show you how and create a sample spreadsheet with the 56 colors available to you. ###### Start Posh Script ######## $xl = new-object -comobject excel.application $xl.Visible = $true $xl.DisplayAlerts = $False $wb = $xl.Workbooks.Add() $ws = $wb.Worksheets.Item(1) $row = 1 $i = 1 For($i = 1; $i -lt 56; $i++){ $ws.Cells.Item($row, 1) = "'$'ws.Cells.Item($row, 2).Font.ColorIndex = " + $row #<-- row 10 $ws.Cells.Item($row, 2).Font.ColorIndex = $row $ws.Cells.Item($row, 2) = "test " + $row $row++ } [void]$ws.cells.entireColumn.Autofit() ############# End POSH Script ############### Try taking the ' out from around the $ in row 10 and see what you get.. Be sure you do if you want to just cut and paste the cell.



