Search Results

Search found 518 results on 21 pages for 'vbscript'.

Page 10/21 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Cannot execute cut-n-paste VBScripts

    - by IcedDante
    I have been going mad trying to figure out why my scripts weren't working, until I started copying and pasting sample source code directly from a few websites only to have it fail there as well. I am getting the following error in my VBScripts: C:\temp\vbs\script.vbs(19, 53) Microsoft VBScript compilation error: Expected statement' For a line of code that looks like this: wdoc.Application.Selection.Find.Execute Replace:=wdReplaceAll This is interfacing with Microsft Word in Office 2007 to conduct a search and replace. Index 53 point directly to the := part of the assignment. Since this type of syntax doesn't work on my machine and I am using it from several websites, I was wondering if the cscript.exe I use is out of date. Am I not calling cscript properly?

    Read the article

  • Can you detect a 301 redirect with Microsoft.XMLHTTP object?

    - by dmb
    I'm using VBScript and the Microsoft.XMLHTTP object to scrape some web data. I have a list of URLs to check, but unfortunately some of them 301 redirect to others on the list, so I wind up with redundant data. Is it at all possible to make the XMLHTTP object fail on 301 redirect? Or at least cache the original response header? Or otherwise just let me know what happened? (notes: I have no control over the server I'm requesting data from; when I get new data, I could check if it's redundant, but I'd like to avoid that if possible). Any ideas would be greatly appreciated.

    Read the article

  • How to run a program on a specific remote computer

    - by lucc
    Hi, I have got this working line of code I would like to run via VBScript a share program on a remote computer in a domain environment. The first part is ok where it is asking me to enter a computer name, but the problem is in the second part. I don't know how to run the program on the remote computer that I've entered in the first part. computer = inputbox ("What computer do you wish to check? (Press Enter if this computer)","Computer") set WMI = GetObject("WinMgmts://" & computer) If computer="" then computer = "this computer" Dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run("""\\compname\Share\progr.exe""") Set objShell = nothing After running this script, it runs the program on my computer, not on the remote computer. I want to run the program on a specific computer that I have entered from keyboard. Please help. Thank you.

    Read the article

  • Is vbscripting that difficult?

    - by eric young
    I need to write some vbscripts in my new project. I was told by other people that vbscripting is easy, but seems to me, it is not. For example, in the following example (provided by microsoft), these functions: CreateObject, CreateShortcut, as well as these property names: TargetPath, WindowStyle, Hotkey, etc, are used, but I just cannot find the corresponding API documentation about how to use them. In other words, how do you know you need to call these functions in your vbscripts? Visual Studio 2008/2010 do not have templates for vbscript either. Could anybody tell me what I am missing, and what the best way is to do vbscripting? set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oShellLink = WshShell.CreateShortcut(strDesktop _ & "\MyExcel.lnk") oShellLink.TargetPath = _ "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+F" oShellLink.IconLocation = _ "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE, 0" oShellLink.Description = "My Excel Shortcut" oShellLink.WorkingDirectory = strDesktop oShellLink.Save

    Read the article

  • databind a DropDownList control with a list of all sub directories that exist in a particular direct

    - by sushant
    I am wanting to databind a DropDownList control with a list of all sub directories that exist in a particular directory on the server. The directory I want to search is in the root of the application. I am fairly new to programming and I'm not sure where to even start. I found this code on a website: Dim root As String = "C;\" Dim folders() As String = Directory.GetDirectories(root) Dim sb As New StringBuilder(2048) Dim f As String For Each f In folders Dim foldername As String = Path.GetFileName(f) sb.Append("<option>") sb.Append(foldername) sb.Append("</option>") Next Label3.Text = "<select runat=""sever"" id=""folderlist""" & sb.ToString() & "</select>" I guess this is vb. but my tool is in asp, so is their something similar in vbscript so that I can use it.

    Read the article

  • Write to file using CopyHere without using WScript.Sleep

    - by mlevit
    Hi guys, I've written a small VBScript to creates a .zip file and then copies the contents of a specified folder into that .zip file. I copy the files over one by one for a reason (I know I can do the whole lot at once). However my problem is when I try to copy them one by one without a WScript.Sleep between each loop iteration I get a "File not found or no read permission." error; if I place a WScript.Sleep 200 after each write it works but not 100% of the time. Pretty much I'd like to get rid of the Sleep function and not rely on that because depending on the file size it may take longer to write therefore 200 milliseconds may not be enough etc. As you can see with the small piece of code below, I loop through the files, then if they match the extension I place them into the .zip (zipFile) For Each file In folderToZip.Items For Each extension In fileExtensions if (InStr(file, extension)) Then zipFile.CopyHere(file) WScript.Sleep 200 Exit For End If Next Next Any suggestions on how I can stop relying on the Sleep function? Thanks

    Read the article

  • How to read utf-8 xml from vbs and get correct character code

    - by vkjr
    I'm trying to read xml file from vbs script. Xml is encoded in utf-8 and has appropriate header From vbs script I use microsoft xmldom parser to read xml: Dim objXMLDoc Set objXMLDoc = CreateObject( "Microsoft.XMLDOM" ) objXMLDoc.load("vbs_strings.xml") Inside xml I'm trying to write character by code using &#nnn; notation. Then I read this character from vbscript and try to get it's code using Asc() function. For some characters it works fine and read code is equal to one written. But for some characters Asc() always returns code 63. What could it be? Examples: If xml contains <section>&#195;<section> and in script I have Section variable for representing this xml node then code: Asc(Section.Text) will return value 195 and it's ok. If xml contains <section>&#110;<section> then code: Asc(Section.Text) will return value 110 and it's ok. But if xml contains <section>&#130;<section> or <section>&#156;<section> or <section>&#140;<section> Asc(Section.Text) will return value 63 and it's definitely not good. Do you know why?

    Read the article

  • IE browser script to determine which (if any) ActiveX control will handle specific mime type

    - by Jay13
    I'm trying to figure out in an IE script (javascript or vbscript) which ActiveX control will handle a specific mime type, "image/tiff" in this case. This is easy to do in other browsers that use plugins with; navigator.mimeTypes["image/tiff"].enabledPlugin.name which would return something like QuickTime Plug-in X.X.X I've found plenty of examples to tell if a specific plugin is loaded but since there are several plugins available that can handle tiff images I need to know which, if any, is registered to handle this mime type. The problem I'm trying to deal with is that QuickTime always wants to register itself as the default tiff viewer but it does a terrible job of it resulting in lots of support calls. Unfortunately, simply detecting that QuickTime is installed isn't good enough since the user may also have another tiff viewer installed (like Alternatiff) as the default tiff viewer or the user may have configured QuickTime to not be the default viewer for tiff images so the browser could be using a helper app to display the image instead. Not meaning to be difficult but before anyone suggests reengineering workarounds; yes I know I could force the user to use a specific ActiveX viewer in IE or to use a Java tiff viewer but I'd rather let them use a viewer of their choice rather than forcing them to install a viewer of my choosing, especially since their viewer may be a helper app that loads the tiff image into a business workflow within their office yes I know there are other image formats that I could use but tiff is the defacto standard for document imaging and that's what the vast majority of these users prefer to use. The problem isn't the image format, it's that QuickTime just doesn't cut it as a tiff viewer Thanks in advance for any suggestions or solutions...

    Read the article

  • Reordering columns (fields) in a ADO Recordset

    - by Sukotto
    I have a classic asp webpage written in vbscript that outputs the results from a third-party stored procedure. My user wants the page to display the columns of data in a different order than they come in from the database. Is there an easy and safe way to re-order the columns in an ADO recordset? I did not write this page and cannot change the SP. What is the minimum change I can make here to get the job done and not risk screwing up all the other stuff in the page? The code looks something like dim Conn, strSQL, RS Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open ServerName Set strSQL = "EXEC storedProc @foo = " & Request("fooParam") 'This stored procedure returns a date column, an arbitrary ' ' number of data columns, and two summation columns. We ' ' want the two summation columns to move so they appear ' ' immediately after the data column ' Set RS = Server.CreateObject("ADODB.RecordSet") RS.ActiveConnection = Nothing RS.CursorLocation = adUseClient RS.CursorType = adOpenStatic RS.LockType = adLockBatchOptimistic RS.Open strSQL, Conn, adOpenDynamic, adLockOptimistic dim A ' ----- ' ' Insert some code here to move the columns of the RS around ' ' to suit the whim of my user ' ' ----- ' ' Several blocks of code that iterate over the RS and display it various ways ' RS.MoveFirst For A = 0 To RS.Fields.Count -1 ' do stuff ' Next ... RS.MoveFirst For A = 0 To RS.Fields.Count -1 ' do more stuff ' Next RS.Close : Set RS = Nothing Conn.Close : Set Conn = Nothing

    Read the article

  • Using a variable derived from a drop-down list as the column name in a select statement ... Access DB

    - by user1459698
    I'm working with the world's worst DB that was already here so don't blame me for that. So, here's what I have so far ... module = txtModule.value presstype = txtPressType.value SQL_query = "SELECT * FROM tbl_spareparts WHERE '"& module &"' <> '""' AND '"& module &"' = '"& presstype &"' AND Manufacturer = '"& txtsrch.value &"' ORDER BY SAP_Part_No" Set rsData = conn.Execute(SQL_query) This brings up the following SQL statement: SELECT * FROM tbl_spareparts WHERE 'Banyan_Module' <> '"' AND 'Banyan_Module' = 'PB' AND Manufacturer = 'Tester' ORDER BY SAP_Part_No Is there any way I can use the module variable as a column name - obviously the ''s around the column name are causing an error. This is really bothering me. BTW, I'm writing this in VBScript inside a .HTA application page as it has to run locally on tech PCs. Thanks. R.

    Read the article

  • File Folder copy

    - by Dario Dias
    Below is the VBScript code. If the file/s or folder exist I get scripting error, "File already exists". How to fix that? How to create folder only if it does not exist and copy files only that are new or do not exist in source path? How to insert the username (Point 1) after "Welcome" and at (Poin 3) instead of user cancelled? Can the buttons be changed to Copy,Update,Cancel instead of Yes,No,Cancel? (Point 2) The code: Set objFSO = CreateObject("Scripting.FileSystemObject") Set wshShell = WScript.CreateObject( "WScript.Shell" ) strUserName = wshShell.ExpandEnvironmentStrings( "%USERNAME%" ) Message = " Welcome to the AVG Update Module" & vbCR '1* Message = Message & " *****************************" & vbCR & vbCR Message = Message & " Click Yes to Copy Definition Files" & vbCR & vbCR Message = Message & " OR " & vbCR & vbCR Message = Message & " Click No to Update Definition Files." & vbCR & vbCR Message = Message & " Click Cancel (ESC) to Exit." & vbCR & vbCR X = MsgBox(Message, vbYesNoCancel, "AVG Update Module") '2* 'Yes Selected Script If X = 6 then objFSO.FolderExists("E:\Updates") if TRUE then objFSO.CreateFolder ("E:\Updates") objFSO.CopyFile "c:\Docume~1\alluse~1\applic~1\avg8\update\download\*.*", "E:\Updates\" , OverwriteFiles MsgBox "Files Copied Succesfully.", vbInformation, "Copy Success" End If 'No Selected Script If X = 7 then objFSO.FolderExists("Updates") if TRUE then objFSO.CreateFolder("Updates") objFSO.CopyFile "E:\Updates\*.*", "Updates", OverwriteFiles Message = "Files Updated Successfully." & vbCR & vbCR Message = Message & "Click OK to Launch AVG GUI." & vbCR & vbCR Message = Message & "Click Cancel (ESC) to Exit." & vbCR & vbCR Y = MsgBox(Message, vbOKCancel, "Update Success") If Y = 1 then Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "C:\Progra~1\avg\avg8\avgui.exe" & Chr(34), 0 Set WshShell = Nothing End if If Y = 3 then WScript.Quit End IF 'Cancel Selection Script If X = 2 then MsgBox "No Files have been Copied/Updated.", vbExclamation, "User Cancelled" '3* End if

    Read the article

  • ASPX ajax form post help

    - by StealthRT
    Hey all, i have this peice of code that allows a user to select a jpg image, resize it and uploads it to the server driectory. The problem being is that it reloads the aspx page when it saves the image. My question is-is there any way to do this same thing but with ajax so that it doesn't leave the page after submitting it? I've done this pleanty of times with classic asp pages but never with a aspx page. Here is the code for the ASPX page: <%@ Page Trace="False" Language="vb" aspcompat="false" debug="true" validateRequest="false"%> <%@ Import Namespace=System.Drawing %> <%@ Import Namespace=System.Drawing.Imaging %> <%@ Import Namespace=System.Drawing.Text %> <%@ Import Namespace=System %> <%@ Import Namespace=System.IO %> <%@ Import Namespace=System.Web %> <%@ Import Namespace=System.ServiceProcess %> <%@ Import Namespace=Microsoft.Data.Odbc %> <%@ Import Namespace=System.Data.Odbc %> <%@ Import Namespace=MySql.Data.MySqlClient %> <%@ Import Namespace=MySql.Data %> <%@ Import Namespace=System.Drawing.Drawing2D %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.ADO" %> <%@ Import Namespace=ADODB %> <SCRIPT LANGUAGE="VBScript" runat="server"> const Lx = 200 const Ly = 60 const upload_dir = "/img/avatar/" const upload_original = "tmpAvatar" const upload_thumb = "thumb" const upload_max_size = 256 dim fileExt dim newWidth, newHeight as integer dim l2 dim fileFld as HTTPPostedFile Dim originalimg As System.Drawing.Image dim msg dim upload_ok as boolean </script> <% Dim theID, theEmail, maleOrFemale theID = Request.QueryString("ID") theEmail = Request.QueryString("eMail") maleOrFemale = Request.QueryString("MF") randomize() upload_ok = false if lcase(Request.ServerVariables("REQUEST_METHOD"))="post" then fileFld = request.files(0) if fileFld.ContentLength > upload_max_size * 1024 then msg = "Sorry, the image must be less than " & upload_max_size & "Kb" else try fileExt = System.IO.Path.GetExtension(fileFld.FileName).ToLower() if fileExt = ".jpg" then originalImg = System.Drawing.Image.FromStream(fileFld.InputStream) if originalImg.Height > Ly then newWidth = Ly * (originalImg.Width / originalImg.Height) newHeight = Ly end if Dim thumb As New Bitmap(newWidth, newHeight) Dim gr_dest As Graphics = Graphics.FromImage(thumb) dim sb = new SolidBrush(System.Drawing.Color.White) gr_dest.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality gr_dest.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality gr_dest.FillRectangle(sb, 0, 0, thumb.Width, thumb.Height) gr_dest.DrawImage(originalImg, 0, 0, thumb.Width, thumb.Height) try originalImg.save(Server.MapPath(upload_dir & upload_original & fileExt), originalImg.rawformat) thumb.save(Server.MapPath(upload_dir & theID & fileExt), originalImg.rawformat) msg = "Uploaded " & fileFld.FileName & " to " & Server.MapPath(upload_dir & upload_original & fileExt) upload_ok = true File.Delete(Server.MapPath(upload_dir & upload_original & fileExt)) catch msg = "Sorry, there was a problem saving your avatar. Please try again." end try if not thumb is nothing then thumb.Dispose() thumb = nothing end if else msg = "That image does not seem to be a JPG. Upload only JPG images." end if catch msg = "That image does not seem to be a JPG." end try end if if not originalImg is nothing then originalImg.Dispose() originalImg = nothing end if end if %><head> <meta http-equiv="pragma" content="no-cache" /> </head> <html> <script type="text/javascript" src="js/jquery-1.3.min.js"></script> <form enctype="multipart/form-data" method="post" runat="server" id="sendImg"> <input type="file" name="upload_file" id="upload_file" style="-moz-opacity: 0; opacity:0; filter: alpha(opacity=0); margin-top: 5px; float:left; cursor:pointer;" onChange="$('#sendImg').submit();" > <input type="submit" value="Upload" style="visibility:hidden; display:none;"> </form> </body> </html> Any help would be great! :o) David

    Read the article

  • WMI/VBS/HTML System Information Script

    - by Methical
    Hey guys; havin' a problem with this code here; can't seem to work out whats goin' wrong with it. All other variables seem to print fine in the HTML ouput; but I get an error that relates to the cputype variable. I get the following error C:\Users\Methical\Desktop\sysinfo.vbs(235,1) Microsoft VBScript runtime error: Invalid procedure call or argument I think it has somethin' to do with this line here fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>CPU</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & cputype & "</i></td></tr>" If i delete this line; the script compiles and outputs with no errors. Here is the full code below Dim strComputer, objWMIService, propValue, objItem Dim strUserName, strPassword, colItems, SWBemlocator ' This section querries for the workstation to be scanned. UserName = "" Password = "" strComputer = "127.1.1.1" ImgDir = "C:\Scripts\images\" 'Sets up the connections and opjects to be used throughout the script. Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = SWBemlocator.ConnectServer(,"root\CIMV2",strUserName,strPassword) 'This determines the current date and time of the PC being scanned. Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LocalTime", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem in colItems If objItem.Minute < 10 Then theMinutes = "0" & objItem.Minute Else theMinutes = objItem.Minute End If If objItem.Second < 10 Then theSeconds = "0" & objItem.Second Else theSeconds = objItem.Second End If DateTime = objItem.Month & "/" & objItem.Day & "/" & objItem.Year & " - " & objItem.Hour & ":" & theMinutes & ":" & theSeconds Next 'Gets some ingomation about the Operating System including Service Pack level. Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48) For Each objItem in colItems WKID = objItem.CSName WKOS = objItem.Caption CSD = objItem.CSDVersion Architecture = objItem.OSArchitecture SysDir = objItem.SystemDirectory SysDrive = objItem.SystemDrive WinDir = objItem.WindowsDirectory ServicePack = objItem.ServicePackMajorVersion & "." & objItem.ServicePackMinorVersion Next 'This section returns the Time Zone Set colItems = objWMIService.ExecQuery("Select * from Win32_TimeZone") For Each objItem in colItems Zone = objItem.Description Next 'This section displays the Shadow Storage information Set colItems = objWMIService.ExecQuery("Select * from Win32_ShadowStorage") For Each objItem in colItems Allocated = int((objItem.AllocatedSpace/1024)/1024+1) UsedSpace = int((objItem.UsedSpace/1024)/1024+1) MaxSpace = int((objItem.MaxSpace/1024)/1024+1) Next 'This section returns the InstallDate of the OS Set objSWbemDateTime = _ CreateObject("WbemScripting.SWbemDateTime") Set colOperatingSystems = _ objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem _ in colOperatingSystems objSWbemDateTime.Value = _ objOperatingSystem.InstallDate InstallDate = _ objSWbemDateTime.GetVarDate(False) Next 'This section returns the Video card and current resolution. Set colItems = objWMIService.ExecQuery("Select * from Win32_DisplayConfiguration",,48) For Each objItem in colItems VideoCard = objItem.DeviceName Resolution = objItem.PelsWidth & " x " & objItem.PelsHeight & " x " & objItem.BitsPerPel & " bits" Next 'This section returns the Video card memory. Set objWMIService = GetObject("winmgmts:root\cimv2") Set colItems = objWMIService.ExecQuery ("Select * from Win32_VideoController") For Each objItem in colItems VideoMemory = objItem.AdapterRAM/1024/1024 Next 'This returns various system information including current logged on user, domain, memory, manufacture and model. Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48) For Each objItem in colItems UserName = objItem.UserName Domain = objItem.Domain TotalMemory = int((objItem.TotalPhysicalMemory/1024)/1024+1) Manufacturer = objItem.Manufacturer Model = objItem.Model SysType = objItem.SystemType Next 'This determines the total hard drive space and free hard drive space. Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where Name='C:'",,48) For Each objItem in colItems FreeHDSpace = Fix(((objItem.FreeSpace/1024)/1024)/1024) TotalHDSpace = Fix(((objItem.Size/1024)/1024)/1024) Next 'This section returns the default printer and printer port. Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Printer where Default=True", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem in colItems Printer = objItem.Name PortName = objItem.PortName Next 'This returns the CPU information. Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem in colItems CPUDesc = LTrim(objItem.Name) Next '// CPU Info For each objCPU in GetObject("winmgmts:{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2").InstancesOf("Win32_Processor") Select Case objCPU.Family Case 2 cputype = "Unknown" Case 11 cputype = "Pentium brand" Case 12 cputype = "Pentium Pro" Case 13 cputype = "Pentium II" Case 14 cputype = "Pentium processor with MMX technology" Case 15 cputype = "Celeron " Case 16 cputype = "Pentium II Xeon" Case 17 cputype = "Pentium III" Case 28 cputype = "AMD Athlon Processor Family" Case 29 cputype = "AMD Duron Processor" Case 30 cputype = "AMD2900 Family" Case 31 cputype = "K6-2+" Case 130 cputype = "Itanium Processor" Case 176 cputype = "Pentium III Xeon" Case 177 cputype = "Pentium III Processor with Intel SpeedStep Technology" Case 178 cputype = "Pentium 4" Case 179 cputype = "Intel Xeon" Case 181 cputype = "Intel Xeon processor MP" Case 182 cputype = "AMD AthlonXP Family" Case 183 cputype = "AMD AthlonMP Family" Case 184 cputype = "Intel Itanium 2" Case 185 cputype = "AMD Opteron? Family" End Select Next 'This returns the current uptime (time since last reboot) of the system. Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") For Each objOS in colOperatingSystems dtmBootup = objOS.LastBootUpTime dtmLastBootupTime = WMIDateStringToDate(dtmBootup) dtmSystemUptime = DateDiff("h", dtmLastBootUpTime, Now) Uptime = dtmSystemUptime Next Function WMIDateStringToDate(dtmBootup) WMIDateStringToDate = CDate(Mid(dtmBootup, 5, 2) & "/" & Mid(dtmBootup, 7, 2) & "/" & Left(dtmBootup, 4) & " " & Mid (dtmBootup, 9, 2) & ":" & Mid(dtmBootup, 11, 2) & ":" & Mid(dtmBootup,13, 2)) End Function dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") ' -- The heart of the create file script ----------------------- ' -- Creates the file using the value of strFile on Line 11 ' -------------------------------------------------------------- Set fileOutput = objFSO.CreateTextFile( "x.html", true ) 'Set fileOutput = objExplorer.Document 'This is the code for the web page to be displayed. fileOutput.WriteLine "<html>" fileOutput.WriteLine " <head>" fileOutput.WriteLine " <title>System Information for '" & WKID & "' </title>" fileOutput.WriteLine " </head>" fileOutput.WriteLine " <body bgcolor='#FFFFFF' text='#000000' link='#0000FF' vlink='000099' alink='#00FF00'>" fileOutput.WriteLine " <center>" fileOutput.WriteLine " <h1>System Information for " & WKID & "</h1>" fileOutput.WriteLine " <table border='0' cellspacing='1' cellpadding='1' width='95%'>" fileOutput.WriteLine " <tr><td background='" & ImgDir & "blue_spacer.gif'>" fileOutput.WriteLine " <table border='0' cellspacing='0' cellpadding='0' width='100%'>" fileOutput.WriteLine " <tr><td>" fileOutput.WriteLine " <table border='0' cellspacing='0' cellpadding='0' width='100%'>" fileOutput.WriteLine " <tr>" fileOutput.WriteLine " <td width='5%' align='left' valign='middle' background='" & ImgDir & "blue_spacer.gif'><img src='" & ImgDir & "write.gif'></td>" fileOutput.WriteLine " <td width='95%' align='left' valign='middle' background='" & ImgDir & "blue_spacer.gif'> <font color='#FFFFFF' size='5'>WKInfo - </font><font color='#FFFFFF' size='3'>General information on the Workstation.</font></td>" fileOutput.WriteLine " </tr>" fileOutput.WriteLine " <tr><td colspan='2' bgcolor='#FFFFFF'>" fileOutput.WriteLine " <TABLE width='100%' cellspacing='0' cellpadding='2' border='1' bordercolor='#c0c0c0' bordercolordark='#ffffff' bordercolorlight='#c0c0c0'>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><h3>Date and Time</h3></b></TD></TR>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Date/Time</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & DateTime & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>System Uptime</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Uptime & " hours</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Time Zone</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Zone & " </i></td></tr>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><h3>General Computer Information</h3></b></TD></TR>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Manufacturer</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Manufacturer & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Model</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Model & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>System Based</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & SysType & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Operating System</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & WKOS & " " & CSD & " " & Architecture & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Operating System Install Date</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & InstallDate & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>UserName</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & UserName & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Workstation Name</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & WKID & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Domain</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Domain & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>System Drive</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & SysDrive & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>System Directory</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & SysDir & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Windows Directory</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & WinDir & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>ShadowStorage Allocated Space</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Allocated & " MB</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>ShadowStorage Used Space</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & UsedSpace & " MB</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>ShadowStorage Max Space</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & MaxSpace & " MB</i></td></tr>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><h3>General Hardware Information</h3></b></TD></TR>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>CPU</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & cputype & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Memory</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & TotalMemory & " MB</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Total HDD Space</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & TotalHDSpace & " GB</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Free HDD Space</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & FreeHDSpace & " GB</i></td></tr>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><h3>General Video Card Information</h3></b></TD></TR>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Video Card</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & VideoCard & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Resolution</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & Resolution & "</i></td></tr>" fileOutput.WriteLine " <TR><TD width='30%' align='left' bgcolor='#e0e0e0'>Memory</TD><td width='70%' bgcolor=#f0f0f0 align=left><i>" & VideoMemory & " MB</i></td></tr>" 'This section lists all the current services and their status. fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><h3>Current Service Information</h3></b></TD></TR>" fileOutput.WriteLine " <tr><td colspan='2' bgcolor='#f0f0f0'>" fileOutput.WriteLine " <TABLE width='100%' cellspacing='0' cellpadding='2' border='1' bordercolor='#c0c0c0' bordercolordark='#ffffff' bordercolorlight='#c0c0c0'>" fileOutput.WriteLine " <TR><TD width='70%' align='center' bgcolor='#e0e0e0'><b>Service Name</b></td><TD width='30%' align='center' bgcolor='#e0e0e0'><b>Service State</b></td><tr>" Set colRunningServices = objWMIService.ExecQuery("Select * from Win32_Service") For Each objService in colRunningServices fileOutput.WriteLine " <TR><TD align='left' bgcolor='#f0f0f0'>" & objService.DisplayName & "</TD><td bgcolor=#f0f0f0 align=center><i>" & objService.State & "</i></td></tr>" wscript.echo " <TR><TD align='left' bgcolor='#f0f0f0'>" & objService.DisplayName & "</TD><td bgcolor=#f0f0f0 align=center><i>" & objService.State & "</i></td></tr>" Next fileOutput.WriteLine " </table>" fileOutput.WriteLine " </td></tr>" 'This section lists all the current running processes and some information. fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><h3>Current Process Information</h3></b></TD></TR>" fileOutput.WriteLine " <tr><td colspan='2' bgcolor='#f0f0f0'>" fileOutput.WriteLine " <TABLE width='100%' cellspacing='0' cellpadding='2' border='1' bordercolor='#c0c0c0' bordercolordark='#ffffff' bordercolorlight='#c0c0c0'>" fileOutput.WriteLine " <TR><TD width='10%' align='center' bgcolor='#e0e0e0'><b>PID</b></td><TD width='35%' align='center' bgcolor='#e0e0e0'><b>Process Name</b></td><TD width='40%' align='center' bgcolor='#e0e0e0'><b>Owner</b></td><TD width='15%' align='center' bgcolor='#e0e0e0'><b>Memory</b></td></tr>" Set colProcessList = objWMIService.ExecQuery("Select * from Win32_Process") For Each objProcess in colProcessList colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain) fileOutput.WriteLine " <TR><TD align='center' bgcolor='#f0f0f0'>" & objProcess.Handle & "</td><TD align='center' bgcolor='#f0f0f0'>" & objProcess.Name & "</td><TD align='center' bgcolor='#f0f0f0'>" & strUserDomain & "\" & strNameOfUser & "</td><TD align='center' bgcolor='#f0f0f0'>" & objProcess.WorkingSetSize/1024 & " kb</td><tr>" Next fileOutput.WriteLine " </table>" fileOutput.WriteLine " </td></tr>" 'This section lists all the currently installed software on the machine. fileOutput.WriteLine " <TR><TD align='center' bgcolor='#d0d0d0' colspan='2'><b><i>Installed Software</i></b></TD></TR>" fileOutput.WriteLine " <tr><td colspan='2' bgcolor='#f0f0f0'>" Set colSoftware = objWMIService.ExecQuery ("Select * from Win32_Product") For Each objSoftware in colSoftware fileOutput.WriteLine" <TABLE width='100%' cellspacing='0' cellpadding='2' border='1' bordercolor='#c0c0c0' bordercolordark='#ffffff' bordercolorlight='#c0c0c0'>" fileOutput.WriteLine" <tr><td width=30% align=center bgcolor='#e0e0e0'><b>Name</b></td><td width=30% align=center bgcolor='#e0e0e0'><b>Vendor</b></td><td width=30% align=center bgcolor='#e0e0e0'><b>Version</b></td></tr>" fileOutput.WriteLine" <tr><td align=center bgcolor=#f0f0f0>" & objSoftware.Name & "</td><td align=center bgcolor=#f0f0f0>" & objSoftware.Vendor & "</td><td align=center bgcolor=#f0f0f0>" & objSoftware.Version & "</td></tr>" fileOutput.WriteLine" <tr height=2><td height=10 align=center bgcolor=midnightblue colspan=3></td></tr>" fileOutput.WriteLine" </table>" Next fileOutput.WriteLine " </td></tr>" fileOutput.WriteLine " </table>" fileOutput.WriteLine " </td></tr>" fileOutput.WriteLine " </table>" fileOutput.WriteLine " </td></tr>" fileOutput.WriteLine " </table>" fileOutput.WriteLine " </td></tr>" fileOutput.WriteLine " </table>" fileOutput.WriteLine " <p><small></small></p>" fileOutput.WriteLine " </center>" fileOutput.WriteLine " </body>" fileOutput.WriteLine "<html>" fileOutput.close WScript.Quit

    Read the article

  • automation of data format conversion to parent child format

    - by silverkid
    This is an excel sheet which has only a single column filled for each row. (explanation : all CITY categories fall under V21 , all handset categories fall under CityJ and so on ) V21 CITYR CITYJ HandsetS HandsetHW HandsetHA LOWER_AGE<=20 LOWER_AGE>20 SMS_COUNT<=0 RECHARGE_MRP<=122 RECHARGE_MRP>122 SMS_COUNT>0 I need to change this format to a double column format with parent and child category format. therefore the output sheet would be V21 CITYR V21 CITYJ CITYJ HandsetS CITYJ HandsetHW CITYJ HandsetHA HandsetHA LOWER_AGE<=20 HandsetHA LOWER_AGE>20 LOWER_AGE>20 SMS_COUNT<=0 SMS_COUNT<=0 RECHARGE_MRP<=122 SMS_COUNT<=0 RECHARGE_MRP>122 LOWER_AGE>20 SMS_COUNT>0 the datas are huge so i cant do them manually . how can i automate this ?

    Read the article

  • Apply Font Formatting to PowerPoint Text Programatically

    - by OneNerd
    I am trying to use VBA to insert some text into a PowerPoint TextRange, I use something like this: ActiveWindow.Selection.SlideRange.Shapes("rec1").TextFrame.TextRange.Text = "Hi" However, I can't figure out how to apply bold, italic and underline programatically (I don't see a .RichText property or something similar). What I have is some simple HTML text with bold, italic and underlined text I would like to convert over. Does anyone know how to do this?

    Read the article

  • Monitoring disk performance with MRTG

    - by Ghostrider
    I use MRTG to monitor vital stats on my servers like disk space, CPU load, memory usage, temperatures etc. It all works fine and well for parameters that don't change rapidly. By running small VB script I can also get any Performance Counter. However these scripts are called by MRTG every 5 minutes while performance counters like physical disk idle time return a snapshot value from previous few seconds so a lot or data is missed. Surely I could write a service that would poll all required counters in background and store average values somewhere on disk where MRTG would pick them up. However before I do so I would like to find out if there is some ready solution that would allow me to get average value of some counter for the last 5 minutes as opposed to immediate snapshot.

    Read the article

  • OWC does not work with IE8

    - by mactov
    Hi, I have a web page that is generated with Access 2003 and uses Office Web Components. It worked fine with IE6 and IE7 but does not work anymore with IE8. Here are more details. I create an MSODSC component and a WSH object to get my ConnectionString in the registry. Then the Dropdown Lists are fed by a request to the database. It works perfect with IE6 and IE7, works locally with IE8 but if the page is served by IIS to IE8, the drop down lists are empty. Can anyone help me ? Thanks Mactov

    Read the article

  • VBS Runtime error code 800A01B6

    - by salvationishere
    I am a newbie to VBS scripting. I am getting above error on line 54, character 5 in script below. This error says "Object doesn't support this property or method: 'MimeMapArray'". And line it is referring to is: MimeMapArray(i) = CreateObject("MimeMap") Can u tell me what I am doing wrong? Here is the script in its entirety. Note, I am trying to run this on an XP OS by double-clicking this VBS file. ' This script adds the necessary Windows Presentation Foundation MIME types ' to an IIS Server. ' To use this script, just double-click or execute it from a command line. ' Running this script multiple times results in multiple entries in the IIS MimeMap. ' Set the MIME types to be added Dim MimeMapObj Dim MimeMapArray Dim WshShell Dim oExec Const ADS_PROPERTY_UPDATE = 2 Dim MimeTypesToAddArray MimeTypesToAddArray = Array(".manifest", "application/manifest", ".xaml", _ "application/xaml+xml", ".application", "application/x-ms-application", _ ".deploy", "application/octet-stream", ".xbap", "application/x-ms-xbap", _ ".xps", "application/vnd.ms-xpsdocument") ' Get the mimemap object Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap") ' Call AddMimeType for every pair of extension/MIME type For counter = 0 to UBound(MimeTypesToAddArray) Step 2 AddMimeType MimeTypesToAddArray(counter), MimeTypesToAddArray(counter+1) Next ' Create a Shell object Set WshShell = CreateObject("WScript.Shell") ' Stop and Start the IIS Service Set oExec = WshShell.Exec("net stop w3svc") Do While oExec.Status = 0 WScript.Sleep 100 Loop Set oExec = WshShell.Exec("net start w3svc") Do While oExec.Status = 0 WScript.Sleep 100 Loop Set oExec = Nothing ' Report status to user WScript.Echo "Windows Presentation Foundation MIME types have been registered." ' AddMimeType Sub Sub AddMimeType(ByVal Ext, ByVal MType) ' Get the mappings from the MimeMap property. MimeMapArray = MimeMapObj.GetEx("MimeMap") ' Add a new mapping. i = UBound(MimeMapArray) + 1 ReDim Preserve MimeMapArray(i) MimeMapArray(i) = CreateObject("MimeMap") MimeMapArray(i).Extension = Ext MimeMapArray(i).MimeType = MType MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray MimeMapObj.SetInfo() End Sub

    Read the article

  • Excel / VB - How do I loop through each row/column and do formatting based on the value?

    - by Johnny 5
    Here's what I need to do: 1) Loop through every cell in a worksheet 2) Make formatting changes (bold, etc) to fields relative to each field based on the value What I mean is that if a field has a value of "foo", I want to make the field that is (-1, -3) from it bold, etc. I tried to do this with the following script with no luck. Thanks Johnny Pseudo Code to Explain: For Each Cell in WorkSheet If Value of Cell is 'Subtotal' Make the cell 2 cells to the left and 1 cell up from here bold and underlined End If End ForEach The Failed Macro (I don't really know VB at all): Sub Macro2() ' ' ' Dim rnArea As Range Dim rnCell As Range Set rnArea = Range("J1:J2000") For Each rnCell In rnArea With rnCell If Not IsError(rnCell.Value) Then Select Case .Value Case "000 Total" ActiveCell.Offset(-1, -3).Select ActiveCell.Font.Underline = XlUnderlineStyle.xlUnderlineStyleSingleAccounting End Select End If End With Next End Sub

    Read the article

  • problem creating object "wscript.shell"

    - by sushant
    my script looks like: Dim WshShell, oExec Set WshShell = CreateObject("WScript.Shell") Set oExec = WshShell.Exec("cmd /c cd D:\d & D: & winzip32.exe -min -a D:\a") Do While oExec.Status = 0 WScript.Sleep 100 Loop WScript.Echo oExec.Status The idea was to use explorer to open these files. The problem I'm having though is on the line: Set WshShell = CreateObject("WScript.Shell") I keep getting the message ActiveX component can't create object: 'WScript.Shell' I'm totally confused because this exact same code runs fine if I write it in a .htm file. Why does my browser treat my .asp page differently than the .html file? How do i fix this problem?

    Read the article

  • How to send SNMP trap to different IP

    - by user147685
    I have the an ASCII message of SNMP traps, how can i sent it to different IP address? i dont want to use email instead. Given a IP address and the port, of that receiver machine. PLease tell me the solution or where can i get references to the command at least. coz i could find anything regarding it. PLease...Hope someone can help me.. thank you very much. regards, dunk

    Read the article

  • Microsoft Word Macro - Exporting Word Review Comments - How do you reference the sentence related to

    - by jspeaks
    I am trying to export of a Word document review comments. I want to export the sentence selection that was commented on followed by the comment. Screen shot of the image: http://jspeaks.com/mswordcomment.png I have found code to loop through the document comments, but I cannot figure out how to reference the sentence selection that the comment was related to. The current logic is: Sub ExportComments() Dim s As String Dim cmt As Word.Comment Dim doc As Word.Document For Each cmt In ActiveDocument.Comments s = s & cmt.Initial & cmt.Index & "," & cmt.Range.Text & vbCr Next Set doc = Documents.Add doc.Range.Text = s End Sub I tinkered with Selection.Range, however I cannot determine the proper object or property that contains the referenced sentence. I would like to produce output like the follow (if we use the example in picture above): Sentence: Here are more sentences that contain interesting facts - Comment: This is an interesting fact. Sentence: Here are more sentences that contain interesting facts. Here are more sentences that contain interesting facts. - Comment: This is a very interesting fact

    Read the article

  • javascript vbcript seek eof

    - by Roman Dorevich
    Hello, I am writing a destop script on windows 2003 and I need to open a file and seek to the end of it and read the last line. I looked for a "seek" but couldn't find. I saw the openTextFile for option but didn't have. I implement it by openning the file with the red flag and then reading line after line. With big file it takes a time, Do any one know how to do this quickly (either in vb script or javascript)

    Read the article

  • Retrieving cached data from existing Crystal Reports file

    - by TimS
    Is there any way to retrieve the cached data from a previously refreshed report and say, dump it to a file? Basically, I'm looking for the dataset that is being used by the report, and hand-dragging each field onto the canvas or even exporting the file doesn't quite get me where I want. I'm not particular to a specific solution, be it .NET, vbscripting or even within the program itself... I'm not overly familiar with the Crystal Report object model, nor .NET, but it seems like with a setting like "EnableSaveDataWithReport", there ought to be a straightforward way. Oh, and I'm on CR 11 Pro

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >