Search found 182 matches

by rasimmer
Tue Mar 20, 2012 2:48 am
Forum: VBScript
Topic: Technet Microsoft: Computer name script
Replies: 10
Views: 10372

Technet Microsoft: Computer name script

It's %computername%, not $computername%
by rasimmer
Tue Mar 20, 2012 1:26 am
Forum: VBScript
Topic: Technet Microsoft: Computer name script
Replies: 10
Views: 10372

Technet Microsoft: Computer name script

I was sticking the VbScript, but if you just want a way to do it you can also use Powershell: $file = "C:Testmycomputer.txt"$env:computername | out-file -filepath $file -force | notepad $file Maybe JVierra can show me a way to make it a one-liner. Powershell allows you to pipe information ...
by rasimmer
Mon Mar 19, 2012 6:34 am
Forum: VBScript
Topic: Technet Microsoft: Computer name script
Replies: 10
Views: 10372

Technet Microsoft: Computer name script

You can use the FileSystemObject (FSO) to manipulate files. Do some research on .OpenTextFile. Your logic would be more like get computer, create (or modify) text file, use WSHShell.Run to open the txt file "notepad C:mytext.txt"rasimmer2012-03-19 13:47:24
by rasimmer
Sun Jan 08, 2012 3:50 am
Forum: Other Scripting Languages
Topic: vbs gui button in HTA ...
Replies: 3
Views: 7951

vbs gui button in HTA ...

I would say to first remove the HTA aspect of it and find VBScript code for Telnet. The HTA is just adding added complexity, you need base Telnet code in VBScript. In addition, .SendKeys is never really a viable solution because the correct item has to be active in the correct field (if applicable) ...
by rasimmer
Fri Oct 07, 2011 5:19 am
Forum: VBScript
Topic: Need help in vbscript
Replies: 5
Views: 4297

Need help in vbscript

When you do any Office automation, the easiest thing to do is ti record a macro in Excel selecting the columns and converting it from VBA (Visual Basic for Applications) to vbScript. You need to probably connect to a sheets collection and do a for loop for each sheet, connect to the sheet to cell(1,...
by rasimmer
Tue Sep 20, 2011 5:26 am
Forum: VBScript
Topic: Cannot execute Scanstate.exe using VBS.
Replies: 6
Views: 7002

Cannot execute Scanstate.exe using VBS.

You need to look at your command line and make sure it's the same thing as your manual command line (i.e. WScript.Echo strCMD). You can also look at scanstate.log to see the command that was run and make a comparison and also determine if you are utilizing the same XML rules in your manual command. ...
by rasimmer
Tue Sep 20, 2011 1:52 am
Forum: VBScript
Topic: Cannot execute Scanstate.exe using VBS.
Replies: 6
Views: 7002

Cannot execute Scanstate.exe using VBS.

You should be able to do something simple, like: Dim objWSHShell : Set objWSHShell = CreateObject("WScript.Shell")Dim strUSMTPath : strUSMTPath = "servershareUSMT"Dim strCMD : strCMD = "%COMSPEC% /C " & strUSMTPath & "scanstate.exe C:StateStore /o /localonl...
by rasimmer
Wed Sep 07, 2011 3:31 am
Forum: Other Scripting Languages
Topic: Access LDAP from HTML using clientside Javascript.
Replies: 3
Views: 12082

Access LDAP from HTML using clientside Javascript.

If you are running it from the local client, then it should be an HTA. The setting above is under Security > Custom > Miscellaneos > Access Data across domains, which is ActiveX security now allowing the browser to access AD (otherwise a website could crawl your AD infrastructure, not good). So, you...
by rasimmer
Tue Sep 06, 2011 1:38 am
Forum: VBScript
Topic: determine OU of logged in user
Replies: 7
Views: 5144

determine OU of logged in user

To further what JVierra was saying, you would have to either create an OU and create a user policy for that OU or create another policy in the existing OU and utilize WMI filtering to apply the policy only to that system. Also, just to take your script a bit further: Dim objWSHShell : Set objWSHShel...
by rasimmer
Tue Aug 24, 2010 2:32 am
Forum: Other Scripting Languages
Topic: Need help setting up an array within an HTA
Replies: 6
Views: 12120

Need help setting up an array within an HTA

Select Case radio1.value Case "1" : strDesktop = "DESKTOP_A-E" Case "2" : strDesktop = "DESKTOP_F-K" Case "3" : strDesktop = "DESKTOP_L-N" Case "4" : strDesktop = "DESKTOP_O-S" Case "5" : strDesktop = "DES...