Hello tvb!
You should be able to do a search in this forumn for "environment variable" and find some useful information. Or, you can check out this FAQ
faq329-5755
which contains some info on environment variables.
Good luck!
How can one script pass and return values to another script?
In my experiences, I have found that there are basically three ways to accomplish this task. Each method has its own pros and cons, so the developer will need to determine which method best suites their needs.
Method 1 û...
Hello Gibbs!
As stated by Kob3, we're here to help. If you are looking to get in to scripting/programming and you are not familiar with such, I recommend that you do start with VB only because it's easy to pick up and learn. In my opinion, it's a very straightforward language that will...
Hello Long!
I don't have time to provide a lot of code for you, but I may be able to provide a starting point. If you're not familiar with VBA in excel, you can quickly learn by recording a macro (Tools -> Macro -> Record New Macro). After recording your macro, edit the macro and review the...
Okedoke, this should help:
Dim objAccess
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\myDB.mdb"
objAccess.DoCmd.RunMacro "macTest"
objAccess.Quit
set objAccess = Nothing
If you want to show that access is running, then include this line...
Hello Spiderdan!
Depending on how your macros are set up, you may have multiple options here. Please expand on what kind of macros you are running (excel, word, other?).
For sending e-mails:
Do a search in this forumn on 'SMTP' or 'CDO.Message'.
If your macros are running in VB, there is a...
Oh, sorry. I guess I was under the impression that 0 always meant successful, my bad :). However, here is something else that you can try...
Option Explicit
Dim objReg
Dim strKeyPath, strComputer, strReturn
Dim aryKeys
Dim i
'Subtrees
Const HKEY_CLASSES_ROOT = &H80000000
Const...
LeighTT,
I ran this code, and it worked for me:
Dim x
const ForAppending = 8, forwriting = 2
Set objShell=CreateObject("WScript.Shell")
Set objfso=CreateObject("Scripting.FileSystemObject")
'set stdout = wscript.stdout
Set oExec = objshell.exec ("Reg query...
...& _
strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceCreationEvent WITHIN 5 WHERE " _
& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent= " _...
LOL, that's too funny tsuji. Any more thoughts? :)
Thank you for your input! The dictionary object is a useful tool that I should get in the habit of using. The only thing I don't like about that solution is that I'm basically trying to create an alternative to a true dll. See, I don't have the...
Hello lytus!
I'm not sure of anyway to change who is running the script durring execution, but I do know you can control this via windows scheduling.
If you want this script to run on demand, perhaps you could write a script to execute a scheduler task? Or, perhaps you could invoke your script...
Hello all! I have posted this question in the VB Script forumn, but there wasn't an answer there to my question. Perhaps there is an XML solution that you guys can help me with! Here is the question...
I'm creating my own custom components (.wsc extension) and have included a method where I...
Thanks for the response dilettante! Interesting solution, but like you mentioned, VB Script is rather limited with this. I was hoping that XML had a way to specify a default value if the parameter was not passed in or something goofy like that.
I'll try posting this in the XML forumn and see...
Hello all! I thought about posting this in the XML forumn, but after browsing through there, I think I might have better luck trying here first...
I'm creating my own custom components (.wsc extension) and have included a method where I want to make some of the parameters optional. Below is how...
kendas,
Are you trying to invoke a VBScript from a batch file, or a batch file from a VBScript? The post from tsuji shows what the code would be if you are invoking a batch file from VBScript.
Thanks
Thank you for the response SeniorGuru! However, what I want to do in my first example is actually cause the error. So, if C:\Test.vbs, C:\Test2.vbs, and C:\Test3.vbs all use a global variable that is the same name, then I want to make sure that they do not conflict. I understand that if I just...
Hello all!
If I have the following script:
<job id="Main">
<script language="VBScript">
OPTION EXPLICIT
Dim intTest
intTest = 1
MsgBox intTest
</script>
<script language="VBScript">
OPTION EXPLICIT
MsgBox intTest
</script>
</Job>
Is there a way to limit the scope of intTest so that...
Here is another solution that is better than writing to a work file, but not as good as using a .wsf file...
'Script A
Dim objShell
Dim objEnv
Set objShell = WScript.CreateObject("WScript.Shell")
Set objEnv = objShell.Environment("User")
objEnv("TestVar") = "10"
objShell.Run "C:\called.vbs"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.