A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Does the Shell method work in VB Script?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 25th 06, 03:24 PM posted to microsoft.public.outlook.program_vba
Culverin
external usenet poster
 
Posts: 26
Default Does the Shell method work in VB Script?

Good Morning:

I've been trying to invoke Robert Sparnaaij's clear cache VB Script from VB
Script code on a custom Appointment Item form using the "Shell" method. I've
been getting "Type mismatch" runtime errors on "Shell"; indicating that it
appears that VB Script thinks that "Shell" is a variable and not a method.

Is the "Shell" method available in VB Script? If so, how do I get it to
work? If not, is there any other method I can use in VB Script to execute a
..VBS saved in a network drive. The path I want to use is
"\\servername\foldername\foldername\Clear_cache.vb s"

Thanks for your help.
Ads
  #2  
Old August 25th 06, 04:52 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Does the Shell method work in VB Script?

Something like this should work:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%windir%\notepad " & WScript.ScriptFullName

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Culverin" wrote in message
...
Good Morning:

I've been trying to invoke Robert Sparnaaij's clear cache VB Script from
VB
Script code on a custom Appointment Item form using the "Shell" method.
I've
been getting "Type mismatch" runtime errors on "Shell"; indicating that it
appears that VB Script thinks that "Shell" is a variable and not a method.

Is the "Shell" method available in VB Script? If so, how do I get it to
work? If not, is there any other method I can use in VB Script to
execute a
.VBS saved in a network drive. The path I want to use is
"\\servername\foldername\foldername\Clear_cache.vb s"

Thanks for your help.


  #3  
Old August 25th 06, 07:17 PM posted to microsoft.public.outlook.program_vba
Culverin
external usenet poster
 
Posts: 26
Default Does the Shell method work in VB Script?

Thanks Ken.

This worked for me(the server-name is first):

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run
"\\sh19p001\wrkbench\Other_Projects\NASA\Clear_Cac he\Clear_cache.vbs"

I just need to test to see if this works for our users. Granting
permissions to "Everyone" to the Clear_Cache directory should be all I need
to do to ensure that
this will work for all of our users across the country.

What is "%windir%"?

"Ken Slovak - [MVP - Outlook]" wrote:

Something like this should work:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%windir%\notepad " & WScript.ScriptFullName

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Culverin" wrote in message
...
Good Morning:

I've been trying to invoke Robert Sparnaaij's clear cache VB Script from
VB
Script code on a custom Appointment Item form using the "Shell" method.
I've
been getting "Type mismatch" runtime errors on "Shell"; indicating that it
appears that VB Script thinks that "Shell" is a variable and not a method.

Is the "Shell" method available in VB Script? If so, how do I get it to
work? If not, is there any other method I can use in VB Script to
execute a
.VBS saved in a network drive. The path I want to use is
"\\servername\foldername\foldername\Clear_cache.vb s"

Thanks for your help.



  #4  
Old August 25th 06, 08:18 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Does the Shell method work in VB Script?

%windir% is an environment variable that refers to C:\Winnt or C:\Windows
(depending on OS).

A script blocker would block that from running, script blockers don't like
CreateObject. Other than that if you have user permissions on wherever
you're writing to you should be OK.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Culverin" wrote in message
...
Thanks Ken.

This worked for me(the server-name is first):

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run
"\\sh19p001\wrkbench\Other_Projects\NASA\Clear_Cac he\Clear_cache.vbs"

I just need to test to see if this works for our users. Granting
permissions to "Everyone" to the Clear_Cache directory should be all I
need
to do to ensure that
this will work for all of our users across the country.

What is "%windir%"?


  #5  
Old October 29th 11, 07:58 AM
Quinton1 Quinton1 is offline
Junior Member
 
First recorded activity at Outlookbanter: Oct 2011
Posts: 4
Default

Quote:
Originally Posted by Ken Slovak - [MVP - Outlook] View Post
%windir% is an environment variable that refers to C:\Winnt or C:\Windows
(depending on OS).

A script blocker would block that from running, script blockers don't like
CreateObject. Other than that if you have user permissions on wherever
you're writing to you should be OK.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Culverin" wrote in message
...
Thanks Ken.

This worked for me(the server-name is first):

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run
"\\sh19p001\wrkbench\Other_Projects\NASA\Clear_Cac he\Clear_cache.vbs"

I just need to test to see if this works for our users. Granting
permissions to "Everyone" to the Clear_Cache directory should be all I
need
to do to ensure that
this will work for all of our users across the country.

What is "%windir%"?
I've been trying to invoke Robert Sparnaaij's clear cache VB Script from VB
Script code on a custom Appointment Item from using the "Shell" method. I've
been getting "Type mismatch" runtime errors on "Shell"; indicating that it
appears that VB Script thinks that "Shell" is a variable and not a method.

Is the "Shell" method available in VB Script? If so, how do I get it to
work? If not, is there any other method I can use in VB Script to execute a
.VBS saved in a network drive. The path I want to use is
"\\servername\foldername\foldername\Clear_cache.vb s"

Thanks for your help.
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell with attachments kpg Outlook Express 4 August 7th 06 01:17 PM
Rule 'run a script' not running my script [email protected] Outlook and VBA 3 May 30th 06 01:09 PM
"Run a script" rule triggers but script does not execute Trey Shaffer Outlook and VBA 7 April 8th 06 12:34 AM
Outlook form with VB script wont work Hellstern Outlook - Using Forms 1 March 31st 06 03:21 PM
Restrict Method DNW emanson Outlook and VBA 14 March 28th 06 06:47 AM


All times are GMT +1. The time now is 04:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.