grab our rss feed

stevienova.com

Homepage of Steve Novoselac

Entries Tagged ‘Scripting’

Cisco VPN – Launch a Hidden Constant PING Window on Connect

The other day I blogged about getting Cisco VPN to stay connect in Vista. The fix was a constant ping. It is all good but then you have this CMD window open all day in your taskbar, just taking up space, etc. I decided to workaround it. I created a .vbs (Visual Basic Script) called [...]

View Comments | 3,352 views

VBA – Reading a Base64 Element into XML and using as Byte Array

Ok, more VBA Getting a response back as Base64, but when trying to convert it from XML to binary data just having issues.. coming back as ASCII which converts wacked. What you need to do: Dim MyInfo As MSXML2.IXMLDOMNodeListSet MyInfo = xmlDoc.getElementsByTagName(“MyBase64Element”)MyInfo .Item(0).DataType = “bin.base64″ Dim image() As Byteimage = MyInfo .Item(0).nodeTypedValue then you can [...]

View Comments | 1,596 views

MSXML2.IXMLDOMNodeList – Loading XML from files or strings

Again with the VBA, working with MSXML2.IXMLDOMNodeList objects. How do you load XML? Well MSDN shows you how to do it from an XML file.. Loading from an XML File: Dim MyIXMLDOMNodeListVar As MSXML2.IXMLDOMNodeListDim xmlDoc As New MSXML2.DOMDocument30 xmlDoc.Load “c:\myxml.xml” If (xmlDoc.parseError.ErrorCode <> 0) Then   Dim myErr   Set myErr = xmlDoc.parseError   MsgBox (“You have error [...]

View Comments | 4,670 views

VBA vs VB.NET – turn bytes into bitmaps

So, recently working on some things, I have noticed the HUGE difference between VBA and VB.NET, specifically with turning bytes into bitmaps.. (assume GiveMeBytes() returns a byte array that is a bitmap) VB.NET: Dim image As Byte() = GiveMeBytes()Dim memStream As MemoryStream = New MemoryStream(image)Dim bitImage As Bitmap = New Bitmap(System.Drawing.Image.FromStream(memStream)) bitImage.Save(“C:\test.bmp”)   VBA: Dim [...]

View Comments | 4,638 views

Reporting Services Scripter: Sync Reporting Services Instances and Objects

The other day, I was tasked with moving all objects from one SQL Server Reporting Services instance to another. I know you can move the database itself, but then you run into issues with encryption keys etc. I just wanted to move the objects. I know that pretty much everything in SSRS is extensible, so [...]

View Comments | 1,955 views

Route: Saturday Night Programming after the bars..

OK, I have to admit, this is weak. But, if you want to learn how to create an infinite loop, with one word, this is it. Route. I happened upon this maybe 5-6 years ago, when we ended up having to set static routes on computers because of some goofy office politics, but anyways.. Create [...]

View Comments | 894 views

1729 – Saturday Night Programming before the bars: Natural Numbers…

Ok, so this afternoon I watched the movie “Proof” – really good movie. In the movie, they talk about the number 1729, about how it is the smallest number expressible as the sum of two cubes in two different ways. It also is a natural number – when its digits are added together, produces a [...]

View Comments | 923 views

ForFiles – Delete files older than X amount of Days

Windows 2003 – ForFiles FORFILES /P C:\MyPath\ /S /M log*.xml /D -30 /C “cmd /c del @file” /S – look at subdirectories log*.xml – that is the file pattern, you could have it be like *.txt for example /D -30 = files greater than 30 days /C – thats the command you want to run [...]

View Comments | 16,513 views

IE7 – Adding Default Search Provider Through the Windows Registry

So, IE7 – cool right, new search bar and everything. And you can go here and add new search providers. You can also use what Microsoft gives you and do it this way. But alas, what if you want to add it without user intervention? Remotely over a network maybe? Or you just want to [...]

View Comments | 9,241 views

WMIC in Windows

This is why I love computing, you learn something new all the time. WMIC (Windows Management Instrumentation Command-line tool) is something I have never even heard of until yesterday. It always seems when I am looking for a solution I find something in the blogosphere around the same time, but this is crazy. With this [...]

View Comments | 806 views