![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
%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
|
|||
|
|||
![]() Quote:
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 |
Display Modes | |
|
|
![]() |
||||
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 |