Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 6th, 2009, 11:08 AM
Paul_71 Paul_71 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 3 Paul_71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 27 sec
Reputation Power: 0
Script required to check if an app is installed if not install it..

Hi can anyone help me ?
I need a script that will check if an app is installed and if not install it on windows XP and Vista clients. This will be a VB script in the login option in group policy;

If the program is installed it will be in this location;
C:\Program Files\Sophos anti-virus\savmain.exe

If it is not installed i need it to pull this install exe from here;
\\rsnukarc01\app02\sophos\sophos_uk.exe

Can anyone help me please

If you need any other info please let me know.

Thanks Guys

Paul...

Last edited by Paul_71 : March 6th, 2009 at 11:08 AM. Reason: missed a word out in title

Reply With Quote
  #2  
Old March 7th, 2009, 04:46 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,905 Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 2 Days 11 h 13 m 12 sec
Reputation Power: 969
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
How about something like this?
vb Code:
Original - vb Code
  1. Set WshShell = CreateObject("WScript.Shell")
  2. Set objFso = CreateObject("Scripting.FileSystemObject")
  3.  
  4. If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then
  5.     WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
  6. End If
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
  #3  
Old March 9th, 2009, 06:07 AM
Paul_71 Paul_71 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 3 Paul_71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 27 sec
Reputation Power: 0
Quote:
Originally Posted by Nilpo
How about something like this?
vb Code:
Original - vb Code
  1. Set WshShell = CreateObject("WScript.Shell")
  2. Set objFso = CreateObject("Scripting.FileSystemObject")
  3.  
  4. If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then
  5.     WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
  6. End If


Hi Nilpo thanks for this I have zero vbs script experience.I have tried this however I get an error on line 4 char 1
Error: expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error

I copied the script into a file as below;

(Line 1)Set WshShell = CreateObject("WScript.Shell")
(Line 2)Set objFso = CreateObject("Scripting.FileSystemObject")
(Line 3)If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
(Line 4)End If

Any ideas ?

Reply With Quote
  #4  
Old March 9th, 2009, 06:42 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,651 micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Week 4 Days 8 h 58 m 50 sec
Reputation Power: 2312
you didnt copy it right, this line
Code:
If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"

shud be
Code:
If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then 
  WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
these are two different lines not one
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #5  
Old March 9th, 2009, 09:39 AM
Paul_71 Paul_71 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2009
Posts: 3 Paul_71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 27 sec
Reputation Power: 0
Thanks guys !! :)

Quote:
Originally Posted by micky
you didnt copy it right, this line
Code:
If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"

shud be
Code:
If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then 
  WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
these are two different lines not one


Works a treat

Many thanks for your help and speedy response !!

Paul..

Reply With Quote
  #6  
Old March 9th, 2009, 03:19 PM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,905 Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 2 Days 11 h 13 m 12 sec
Reputation Power: 969
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
Quote:
Originally Posted by Paul_71
Works a treat

Many thanks for your help and speedy response !!

Paul..
Awesome! Glad that worked for you.

Reply With Quote
  #7  
Old March 10th, 2009, 03:56 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 12,651 micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)micky User rank is General 20th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Week 4 Days 8 h 58 m 50 sec
Reputation Power: 2312
glad its working now

Reply With Quote
  #8  
Old March 11th, 2009, 08:24 AM
Guddu's Avatar
Guddu Guddu is offline
Contributing User
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Jul 2005
Location: Oxford UK
Posts: 3,894 Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level)Guddu User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 5 Days 22 h 33 m 59 sec
Reputation Power: 984
Quote:
Originally Posted by Paul_71
Hi Nilpo thanks for this I have zero vbs script experience.I have tried this however I get an error on line 4 char 1
Error: expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error

I copied the script into a file as below;

(Line 1)Set WshShell = CreateObject("WScript.Shell")
(Line 2)Set objFso = CreateObject("Scripting.FileSystemObject")
(Line 3)If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
(Line 4)End If

Any ideas ?


u can write statement in one line but in that case do not use end if . like this only if and then .do not use end if .
Code:
If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
__________________
Nothing is Impossible bcoz IMPOSSIBLE itself says..
I M POSSIBLE........................
Be cool !!!!!!!!

Reply With Quote
  #9  
Old June 24th, 2009, 10:58 AM
Bullpen Bullpen is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 1 Bullpen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 52 sec
Reputation Power: 0
Silent .exe install

Hey Nilpo,

Great Script! I tried finding a way to silence my .exe install using everything I know (/q /QUIET /s / SILENT /qn, etc.), but all of the above won't install my .exe silently. Do you know of a silent switch that will enable me to install my .exe quietly?

Please Help.

Quote:
Originally Posted by Nilpo
How about something like this?
vb Code:
Original - vb Code
  1. Set WshShell = CreateObject("WScript.Shell")
  2. Set objFso = CreateObject("Scripting.FileSystemObject")
  3.  
  4. If Not objFso.FileExists("C:\Program Files\Sophos anti-virus\savmain.exe") Then
  5.     WshShell.Run "\\rsnukarc01\app02\sophos\sophos_uk.exe"
  6. End If

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > Script required to check if an app is installed if not install it..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek