Search found 182 matches

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

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: 7144

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 to the nex...
by rasimmer
Mon Mar 19, 2012 6:34 am
Forum: VBScript
Topic: Technet Microsoft: Computer name script
Replies: 10
Views: 7144

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 4:50 am
Forum: Other Scripting Languages
Topic: vbs gui button in HTA ...
Replies: 3
Views: 5875

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: 2760

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: 5065

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: 5065

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 /localonly /c /efs:copyraw " &_ "/v:5 /l:C:MyLogsUSM...
by rasimmer
Wed Sep 07, 2011 3:31 am
Forum: Other Scripting Languages
Topic: Access LDAP from HTML using clientside Javascript.
Replies: 3
Views: 9384

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: 3291

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: 5874

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 = "DESKTOP_T-Z"End SelectstrCMD = "dsmadmc -id=" & strNodeIn & " -password:password Define assoc STAN...