Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: VBSCRIPT TO RUN EXE

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,26260
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: VBSCRIPT TO RUN EXE
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: VBSCRIPT TO RUN EXE - 9/27/2005 7:17:55 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
snipah, as always fast as lightning !

After consultation of my dictionary Eng-> Dutch, I think I should have said "point" instead of "issue".
OK ?



< Message edited by didorno -- 9/27/2005 8:05:52 AM >


_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to Snipah)
 
 
Post #: 21
 
 RE: VBSCRIPT TO RUN EXE - 9/27/2005 8:47:16 AM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
no hard feelings...i knew what you meant to say  (hence the -lol- remark)




_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to didorno)
 
 
Post #: 22
 
 RE: VBSCRIPT TO RUN EXE - 10/3/2005 7:56:02 PM   
  cjwallace

 

Posts: 484
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline

Hi guys. I need to change the script below. I need it to look at the Internal Name of a file not the Manufacturer

I did try changing it but it just went wrong.

Can anyone help me on this

Many thanks

=====================================


strComputer =
"."

Set
oShell = CreateObject("WScript.Shell")

Set
objWMIService = GetObject("winmgmts:" _
&
"{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

' Change the path to where the .exe lives.

Set
colFile = objWMIService.ExecQuery _
(
"Select * from CIM_Datafile Where name = 'E:\\SETUP.exe'")

For
Each objFile In colFile

WScript
.Echo "Drive: " & objFile.Drive

WScript
.Echo "Manufacturer: " & objFile.Manufacturer

Call
Filetest()

WScript
.Echo objFile.Manufacturer

WScript
.Echo "Name: " & objFile.Name

WScript
.Echo "Version: " & objFile.Version

Next


Sub
Filetest()

' Change the Manufacturer to what ever bit of software you wish to run.

If
objFile.Manufacturer = "Symantec Corporation" Then
oShell.Run
"E:\\SETUP.exe"

Else


MsgBox
"ERROR, YOU ARE NOT AUTHORIZED TO RUN THIS...YOU HAVE BEEN REPORTED!"

WScript
.Quit(0)

End
If

End Sub


(in reply to Snipah)
 
 
Post #: 23
 
 RE: VBSCRIPT TO RUN EXE - 10/3/2005 10:57:34 PM   
  mbouchard


Posts: 1804
Score: 12
Joined: 5/15/2003
From: USA
Status: online
quote:

mbouchard and Snipah
You both have an issue.

Huh?  An issue with what?

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Snipah)
 
 
Post #: 24
 
 RE: VBSCRIPT TO RUN EXE - 10/4/2005 6:45:46 AM   
  cjwallace

 

Posts: 484
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
Anyone??

(in reply to mbouchard)
 
 
Post #: 25
 
 RE: VBSCRIPT TO RUN EXE - 10/4/2005 6:51:56 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
quote:

I need it to look at the Internal Name of a file not the Manufacturer


What is the Internal Name of a file?

(in reply to cjwallace)
 
 
Post #: 26
 
 RE: VBSCRIPT TO RUN EXE - 10/4/2005 6:54:47 AM   
  cjwallace

 

Posts: 484
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
The internal name is ISPNICKLE

I cant seem to find any documentation that says wmi can see the Internal Name

(in reply to ebgreen)
 
 
Post #: 27
 
 RE: VBSCRIPT TO RUN EXE - 10/4/2005 7:02:08 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
How is the internal name defined? If WMI cannot see it then I would venture to guess that it is not an OS defined property of a file.

(in reply to cjwallace)
 
 
Post #: 28
 
 RE: VBSCRIPT TO RUN EXE - 10/6/2005 4:59:38 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
mbouchard, the issue was no point, because I concluded already that
the issue had to be a point. If you see what I mean.

B.t.w. does an "issue" sounds that serious ?

Well, to the point, cjwallace, I don't know about an internal name.
In the source of my example can be found the next items for a file

Wscript.Echo "Access mask: " & objFile.AccessMask
Wscript.Echo "Archive: " & objFile.Archive
Wscript.Echo "Compressed: " & objFile.Compressed
Wscript.Echo "Compression method: " & objFile.CompressionMethod
Wscript.Echo "Creation date: " & objFile.CreationDate
Wscript.Echo "Computer system name: " & objFile.CSName
Wscript.Echo "Drive: " & objFile.Drive
Wscript.Echo "8.3 file name: " & objFile.EightDotThreeFileName
Wscript.Echo "Encrypted: " & objFile.Encrypted
Wscript.Echo "Encryption method: " & objFile.EncryptionMethod
Wscript.Echo "Extension: " & objFile.Extension
Wscript.Echo "File name: " & objFile.FileName
Wscript.Echo "File size: " & objFile.FileSize
Wscript.Echo "File type: " & objFile.FileType
Wscript.Echo "File system name: " & objFile.FSName
Wscript.Echo "Hidden: " & objFile.Hidden
Wscript.Echo "Last accessed: " & objFile.LastAccessed
Wscript.Echo "Last modified: " & objFile.LastModified
Wscript.Echo "Manufacturer: " & objFile.Manufacturer
Wscript.Echo "Name: " & objFile.Name
Wscript.Echo "Path: " & objFile.Path
Wscript.Echo "Readable: " & objFile.Readable
Wscript.Echo "System: " & objFile.System
Wscript.Echo "Version: " & objFile.Version
Wscript.Echo "Writeable: " & objFile.Writeable

I don't see an internal name, sorry.

Bye.

_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to mbouchard)
 
 
Post #: 29
 
 RE: VBSCRIPT TO RUN EXE - 10/6/2005 7:17:19 AM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
/me = + dutch mode (for the sake of some explanation, regarding the mentioned "issue" by Didorno)

Didorno: issue  = probleem. Als je iemand zegt dat ie issues heeft, dan zeg je eigenlijk dat ie niet goed bij z'n hoofd is.



/me = on-topic

CJWallace, have you tried Scriptomatic V2? it holds numerous ways of retrieving info on files and such.... ( see the Read me First topic )

< Message edited by Snipah -- 10/6/2005 7:23:34 AM >


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to didorno)
 
 
Post #: 30
 
 RE: VBSCRIPT TO RUN EXE - 10/7/2005 5:04:00 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
Snipah, thank you for your explanation and understanding. MBouchard & Snipah: sorry

CJWallace, Good question !
WBEMTEST.exe does not give a solution (uptil now).
I googled with "version resource" of files.
I see that there are programs available for download, but I don't see
a solution within VBS.
In .Net there are solutions, but I don't use it.

Regards.

_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to Snipah)
 
 
Post #: 31
 
 RE: VBSCRIPT TO RUN EXE - 10/7/2005 7:01:38 AM   
  Snipah


Posts: 1341
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
 
Didorno, no hard feelings............could you post either the .NET link or the variant?

< Message edited by Snipah -- 10/7/2005 7:03:07 AM >


_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to didorno)
 
 
Post #: 32
 
 RE: VBSCRIPT TO RUN EXE - 10/8/2005 4:46:51 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
Snipah, a few .Net links :
http://support.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemreflectionassemblyfileversionattributememberstopic.htm
http://www.nedcomp.nl/support/origdocs/dotnetsdk/cpref/frlrfsystemreflection.htm
http://www.dotnet247.com/247reference/System/Reflection/AssemblyFileVersionAttribute/__members

Bye, bye.

_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to Snipah)
 
 
Post #: 33
 
 RE: VBSCRIPT TO RUN EXE - 10/11/2005 6:41:51 AM   
  didorno

 

Posts: 361
Score: 0
Joined: 2/12/2005
From:
Status: offline
cjwallace, I think I found your internal name solution.
You can download from http://www.jsware.net the file filprops.zip.
If you unpack this you get among others File Props.vbs.
Then add after line 46 :
             s = s & "Internal file name: " & AReturn(6) & VBCrLf
             s = s & "Product Version: " & AReturn(7) & VBCrLf
Renumber the lines after this and search then for line 257.
Change  Dim AInfo(5)   into  Dim AInfo(7)
Add after line 264 :
       AInfo(6) = GetInfo(sDat, "InternalName")
       AInfo(7) = GetInfo(sDat, "ProductVersion")

If you now drag an exe onto this vbs file, you will get the version info you needed.

Good luck !

_____________________________

Regular Expression ? I (L+o{1,}v{1,3}e\s)+[iI]t!$

(in reply to didorno)
 
 
Post #: 34
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: VBSCRIPT TO RUN EXE Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts