Question

Email from startup when there is a change in the Ram.

Asked by: bsharath

Hi,

Email from startup when there is a change in the Ram.
On startup create a txt file in System32 on next login check the create file. If there is a change then email the change to a specific address. i dont know if this is possible. Can anyone help on such script.

Regards
Sharath

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-11-02 at 09:49:00ID24864496
Tags

Script

,

Bat

,

vbs

Topics

Programming Languages

,

Windows Batch Scripting

,

VB Script

Participating Experts
2
Points
500
Comments
35

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. RAM?????????????????
    Ok here it goes.i have installed a 256pc133 sdram to my motherboard.i already had a 128pc100 sdram installed. now i have 384sdram altogether.well the problem is that it shows all 384 installed but the performace has not changed.(resource support has not changed) basically i ...
  2. Startup errors with "startup programs"
    I dumbed up and got a trojan, and some malware on my computer. I've scanned the hard drive to death. When I startup XP pro I get the windows error box telling me some programs could not be loaded and do I want to send a report. I've tried msconfig.. etc. Any Ideas? My system...
  3. Startup
    Hi there, My PC is slow at the moment. Please could someone advise me how I can stop applications opening at startup and also areas that I can free up memory in (i.e. safely delete files). I have deleted my IE cookies and internet files on PC, but not sure where else I can...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: rejoinderPosted on 2009-11-02 at 11:35:31ID: 25722825

Try this one out...

It checks to see if the file exists.  If not it creates the file and makes the value = 0.  The RAM is checked and if the amout of RAM is different from that stored in the file, it will email you.  For all computers running this the first time, you should get an email.  From that point on, if the RAM changes, you will be emailed.

Change the email section to match your environment; to, from, email server etc.

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
 
Set fso     = CreateObject("Scripting.FileSystemObject")
Set oShell  = CreateObject( "WScript.Shell" )
windir      = oShell.ExpandEnvironmentStrings("%windir%")
strComputer = oShell.ExpandEnvironmentStrings("%computername%")
strFile     = windir & "\system32\ram.log"
 
if NOT fso.FileExists(strFile) Then
	Set objFile = fso.CreateTextFile(strFile, True)
	objFile.WriteLine("0")
	objFile.Close
end if
 
Set objFile = fso.OpenTextFile(strFile, 1)
strContents = objFile.ReadAll
objFile.Close
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalMemoryConfiguration", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
	if strContents <> objItem.TotalPhysicalMemory then
		Set wshShell = WScript.CreateObject("WScript.Shell")
		Set objFile  = fso.OpenTextFile(strFile, 2, True)
		objFile.WriteLine(objItem.TotalPhysicalMemory)
		objFile.Close
		SendAlert strContents,objItem.TotalPhysicalMemory,strComputer
	end if
Next
 
Sub SendAlert(OriginalRAM,CurrentRAM,sComputer)
	On Error Resume Next
 
	Dim objMessage
	Set objMessage = CreateObject("CDO.Message")
	with objMessage
		.From = "helpdesk@yourdomain.com" 
		.To = "helpdesk@yourdomain.com"
		.Subject = "The machine " & sComputer & " has had a change in RAM"
		.TextBody = "Please confirm that the computer '" & sComputer & "' has had a change in RAM." & vbCRLF & "Last known RAM value: " & OriginalRAM & vbCRLF & "Current RAM value: " & CurrentRAM
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "emailserver"
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
		.Configuration.Fields.Update
		.Send
	end with 
	Set objMessage = Nothing
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:

Select allOpen in new window

 

by: bsharathPosted on 2009-11-02 at 18:40:12ID: 25725678

Thank U

But for every run i get an email

1st mail

Please confirm that the computer 'IN-DSM' has had a change in RAM.
Last known RAM value: 0

Current RAM value: 3931600

2nd mail

Please confirm that the computer 'IN-DSM' has had a change in RAM.
Last known RAM value: 3931600

Current RAM value: 3931600

 

by: x-menPosted on 2009-11-03 at 00:50:42ID: 25727038

change line 17 to:
                                strContents = objFile.ReadLine

change line 23 to:
                               if trim(strContents) <> trim(objItem.TotalPhysicalMemory) then

 

by: bsharathPosted on 2009-11-03 at 01:07:47ID: 25727123

Thanks perfect\
Can i get the ram data like this
1 Gb
2 Gb
4 Gb
8 Gb
Instead of the bytes

 

by: bsharathPosted on 2009-11-03 at 01:32:39ID: 25727241

And
I had 1 Gb in a machine and upgraded to 2 but did not receive an email

Please confirm that the computer 'D2548' has had a change in RAM.
Last known RAM value: 0
Current RAM value: 1038404

 

by: bsharathPosted on 2009-11-03 at 01:34:05ID: 25727245

Is there any way i remove the first email... Like do not send firat email.

As i have 1000's of systems...

 

by: x-menPosted on 2009-11-03 at 01:39:53ID: 25727277

alter Line 41:

.TextBody = "Please confirm that the computer '" & sComputer & "' has had a change in RAM." & vbCRLF & "Last known RAM value: " & FormatNumber(OriginalRAM/1048576,2) & " Gb" & vbCRLF & "Current RAM value: " & FormatNumber(CurrentRAM/1048576,2) & " Gb"



Note the "FormatNumber(####,2)" : the number 2 refers to number of digits after decimal.

 

by: bsharathPosted on 2009-11-03 at 01:44:05ID: 25727299

Thanks that part works...
But if the ram is changed. Mail does not arrive
And
Can we skip the first email
Like create the log file and dont email

 

by: x-menPosted on 2009-11-03 at 01:52:17ID: 25727341

To skip the first email:

Add:

                If strContents =  0 Then
                      WScript.Quit
                End IF

between lines:
27:            objFile.Close
and
28:            SendAlert strContents,objItem.TotalPhysicalMemory,strComputer

 

by: x-menPosted on 2009-11-03 at 01:53:13ID: 25727348

...like this:

27:            objFile.Close
28:                If strContents =  0 Then
29:                      WScript.Quit
30:                End IF
31:           SendAlert strContents,objItem.TotalPhysicalMemory,strComputer

 

by: bsharathPosted on 2009-11-03 at 21:07:16ID: 25736556

Some times on few machines i get permission error or some other errors. Can all those be skipped. So they dont show up on user end. If there is a issue to excute on startiup then just record the same on the log. No popup on the client

 

by: x-menPosted on 2009-11-04 at 00:50:12ID: 25737463

Add at beginning of the script (line 1:):

1:ON ERROR RESUME NEXT

 

by: bsharathPosted on 2009-11-04 at 02:08:44ID: 25737820

Thank you both...

 

by: bsharathPosted on 2009-11-04 at 09:18:39ID: 25741602

In some machines i get this error
---------------------------
Windows Script Host
---------------------------
Script:      C:\Documents and Settings\All Users\Start Menu\Programs\Startup\Send_Mail_When_Accessed.vbs
Line:      9
Char:      1
Error:      Library not registered.
Code:      8002801D
Source:       (null)

---------------------------
OK  
---------------------------

 

by: rejoinderPosted on 2009-11-04 at 09:32:39ID: 25741737

Strange - the on error statement is in there and it still caused the message?!?  Is there something common that could be found among those getting the error.  All from the same Ghost image or perhaps all are Windows 2000 machines - something like that?

 

by: bsharathPosted on 2009-11-04 at 09:34:56ID: 25741762

Those are random...Some client users call us and complain. We havemore of Windows xp

 

by: rejoinderPosted on 2009-11-04 at 10:22:22ID: 25742202

Do those users have the ability to save into the system32 folder?

 

by: bsharathPosted on 2009-11-04 at 10:26:49ID: 25742254

Yes...Every user is the local admin
1. Could this be an issue when the exchange times out
2. UNC path machine goes down

 

by: rejoinderPosted on 2009-11-04 at 10:48:56ID: 25742493

Can you try this on one of the problem machines?

'On error resume next
 
'Get Windows folder location
Set oShell  = CreateObject( "WScript.Shell" )
windir      = oShell.ExpandEnvironmentStrings("%windir%")
 
'Set some other variables
Set fso     = CreateObject("Scripting.FileSystemObject")
strComputer = oShell.ExpandEnvironmentStrings("%computername%")
strFile     = windir & "\system32\ram.log"
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
objName = objFSO.GetTempName
objTempFile = objName
 
'Run command line to get system information
objShell.Run "cmd /c systeminfo >" & windir & "\system32\" & objTempFile, 0, True
Set objTextFile = objFSO.OpenTextFile(windir & "\system32\" & objTempFile, 1)
strMemory = "0"
Do While objTextFile.AtEndOfStream <> True
	strText = objTextFile.ReadLine
	'Look for the line that has the RAM amount
	If Instr(strText, "Total Physical Memory:") > 0 Then
		strMemory = trim(replace(strText,"Total Physical Memory:",""))
		Exit Do
	End If
Loop
objTextFile.Close
 
'Delete the temp file
Set filesys = CreateObject("Scripting.FileSystemObject") 
filesys.DeleteFile windir & "\system32\" & objTempFile
 
'Create the log file if it does not exist
if NOT fso.FileExists(strFile) Then
	Set objFile = fso.CreateTextFile(strFile, True)
	objFile.WriteLine(strMemory)
	objFile.Close
end if
 
'Read the file
Set objFile = fso.OpenTextFile(strFile, 1)
strContents = replace(objFile.ReadAll,vbCRLF,"")
objFile.Close
 
'Set the log file to the current amount of RAM
Set objFile  = fso.OpenTextFile(strFile, 2, True)
objFile.WriteLine(strMemory)
objFile.Close
 
'Compare the file to what was discovered in the first part of the script
if strContents <> strMemory then
	'There is a change - email an alert
	SendAlert strContents,strMemory,strComputer
end if
 
Sub SendAlert(OriginalRAM,CurrentRAM,sComputer)
	On Error Resume Next
 
	Dim objMessage
	Set objMessage = CreateObject("CDO.Message")
	with objMessage
		.From = "helpdesk@yourdomain.com" 
		.To = "helpdesk@yourdomain.com"
		.Subject = "The machine " & sComputer & " has had a change in RAM"
		.TextBody = "Please confirm that the computer '" & sComputer & "' has had a change in RAM." & vbCRLF & "Last known RAM value: " & OriginalRAM & vbCRLF & "Current RAM value: " & CurrentRAM
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "youremailserver"
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
		.Configuration.Fields.Update
		.Send
	end with 
	Set objMessage = Nothing
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:

Select allOpen in new window

 

by: bsharathPosted on 2009-11-04 at 22:09:27ID: 25747090

Thanks ...Can i know what was the change...

 

by: rejoinderPosted on 2009-11-05 at 08:28:59ID: 25751115

The key difference is this script does not rely on WMI to query and return results.  It is using a command line "systeminfo" which outputs it data to a temp file.  The temp file is read and the one line you are interested in is found and placed in the log file.  If there is a change then you get the email.  The key change is how the script gathers the RAM details.

 

by: bsharathPosted on 2009-11-09 at 23:43:24ID: 25783168

Thanks...At present what will happen if the exchange server is down or the UNC log file is not reachable. Will it error.
IF so then can that be omitted. Like if exchange not found or UNC log not found then do nothing

 

by: rejoinderPosted on 2009-11-10 at 08:32:14ID: 25787009

There is a connect timeout of 60 seconds at line 71 which does what you ask.  If the log file is not found - there will be no email but a new log file will be created.

 

by: bsharathPosted on 2009-11-10 at 08:47:09ID: 25787186

Thanks all seems to be fine now. But the log does not create on Vista machines

 

by: rejoinderPosted on 2009-11-10 at 08:48:45ID: 25787203

Does it show any error messages or the file simply does not appear?

 

by: bsharathPosted on 2009-11-10 at 08:54:47ID: 25787277

File does not get created
I copied the vbs to the vista machine and ran and i get this

---------------------------
Windows Script Host
---------------------------
Script:      C:\Users\Sha\Desktop\Email_Ram_Change.vbs
Line:      19
Char:      1
Error:      File not found
Code:      800A0035
Source:       Microsoft VBScript runtime error

---------------------------
OK  
---------------------------

 

by: rejoinderPosted on 2009-11-10 at 09:39:20ID: 25787748

Can you run this code on the Vista machine - I want to see that the filename and path are showing up.

'On error resume next
 
'Get Windows folder location
Set oShell  = CreateObject( "WScript.Shell" )
windir      = oShell.ExpandEnvironmentStrings("%windir%")
 
'Set some other variables
Set fso     = CreateObject("Scripting.FileSystemObject")
strComputer = oShell.ExpandEnvironmentStrings("%computername%")
strFile     = windir & "\system32\ram.log"
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
objName = objFSO.GetTempName
objTempFile = objName
 
'Run command line to get system information
wscript.echo "cmd /c systeminfo > " & windir & "\system32\" & objTempFile
wscript.quit

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:

Select allOpen in new window

 

by: bsharathPosted on 2009-11-10 at 09:41:16ID: 25787769

I get this

---------------------------
Windows Script Host
---------------------------
cmd /c systeminfo > C:\Windows\system32\rad24609.tmp
---------------------------
OK  
---------------------------

 

by: rejoinderPosted on 2009-11-10 at 10:00:59ID: 25787950

How about this script.  It is moving the log file to the Temp folder where users have write access.

'On error resume next
 
'Get Windows folder location
Set oShell  = CreateObject( "WScript.Shell" )
windir      = oShell.ExpandEnvironmentStrings("%windir%")
 
'Set some other variables
Set fso     = CreateObject("Scripting.FileSystemObject")
strComputer = oShell.ExpandEnvironmentStrings("%computername%")
strFile     = windir & "\system32\ram.log"
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
objName = objFSO.GetTempName
objTempFile = objName
 
'Run command line to get system information
objShell.Run "cmd /c systeminfo > " & windir & "\Temp\" & objTempFile, 0, True
Set objTextFile = objFSO.OpenTextFile(windir & "\Temp\" & objTempFile, 1)
strMemory = "0"
Do While objTextFile.AtEndOfStream <> True
	strText = objTextFile.ReadLine
	'Look for the line that has the RAM amount
	If Instr(strText, "Total Physical Memory:") > 0 Then
		strMemory = trim(replace(strText,"Total Physical Memory:",""))
		Exit Do
	End If
Loop
objTextFile.Close
 
'Delete the temp file
Set filesys = CreateObject("Scripting.FileSystemObject") 
filesys.DeleteFile windir & "\Temp\" & objTempFile
 
'Create the log file if it does not exist
if NOT fso.FileExists(strFile) Then
	Set objFile = fso.CreateTextFile(strFile, True)
	objFile.WriteLine(strMemory)
	objFile.Close
end if
 
'Read the file
Set objFile = fso.OpenTextFile(strFile, 1)
strContents = replace(objFile.ReadAll,vbCRLF,"")
objFile.Close
 
'Set the log file to the current amount of RAM
Set objFile  = fso.OpenTextFile(strFile, 2, True)
objFile.WriteLine(strMemory)
objFile.Close
 
'Compare the file to what was discovered in the first part of the script
if strContents <> strMemory then
	'There is a change - email an alert
	SendAlert strContents,strMemory,strComputer
end if
 
Sub SendAlert(OriginalRAM,CurrentRAM,sComputer)
	On Error Resume Next
 
	Dim objMessage
	Set objMessage = CreateObject("CDO.Message")
	with objMessage
		.From = "helpdesk@yourdomain.com" 
		.To = "helpdesk@yourdomain.com"
		.Subject = "The machine " & sComputer & " has had a change in RAM"
		.TextBody = "Please confirm that the computer '" & sComputer & "' has had a change in RAM." & vbCRLF & "Last known RAM value: " & OriginalRAM & vbCRLF & "Current RAM value: " & CurrentRAM
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "youremailserver"
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
		.Configuration.Fields.Update
		.Send
	end with 
	Set objMessage = Nothing
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:

Select allOpen in new window

 

by: bsharathPosted on 2009-11-10 at 10:06:10ID: 25787987

I get this

---------------------------
Windows Script Host
---------------------------
Script:      C:\Users\Sha\Desktop\Email_Ram_Change.vbs
Line:      44
Char:      1
Error:      Input past end of file
Code:      800A003E
Source:       Microsoft VBScript runtime error

---------------------------
OK  
---------------------------

 

by: rejoinderPosted on 2009-11-10 at 10:07:35ID: 25788000

Sorry about that - can you edit line 10 to read;
strFile     = windir & "\temp\ram.log"

 

by: bsharathPosted on 2009-11-10 at 10:10:03ID: 25788020

Yes now it works .... But the temp files get deleted on startup. I have a GPO which does that....

 

by: rejoinderPosted on 2009-11-10 at 10:55:43ID: 25788445

The temp folder is the only sure fire way of saving the data without messing around with folder permissions.  For the script (ID:25742493 above) to work, change the security settings on the system32 folder to allow users write access.

 

by: bsharathPosted on 2009-11-10 at 18:43:51ID: 25791947

Ok thanks
Can i remove the commente colon on this line
'On error resume next

 

by: rejoinderPosted on 2009-11-10 at 20:25:37ID: 25792275

yes this will continue the script. I'm not at my computer so I am not sure if the script will email if the file was not saved.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...