Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Programmer1974

    Set environment variable from VBScript

    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!
  2. Programmer1974

    How can one script pass and return values to another script?

    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 û...
  3. Programmer1974

    VBScript or NOT!!

    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...
  4. Programmer1974

    Need Help Transferring Data From Excel To Access

    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...
  5. Programmer1974

    Create code to run macro and email

    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...
  6. Programmer1974

    Create code to run macro and email

    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...
  7. Programmer1974

    redirecting stdout using run command

    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...
  8. Programmer1974

    redirecting stdout using run command

    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...
  9. Programmer1974

    Copying files

    Hello ferryjenny! I offer you two solutions. 1. Figgure out a way to call a copy script as part of the normal processes that you spoke of. If you defined what those processes are, I/we could help you achieve this. This is your best solution because if you write a script to pick up the files...
  10. Programmer1974

    making parameters optional in custom VB component

    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...
  11. Programmer1974

    Running a script as a different user

    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...
  12. Programmer1974

    optional parameters in XML/VB Script custom component

    Hello again! Does anyone have any ideas on this, or is this the wrong forumn to post this question? Thanks!
  13. Programmer1974

    optional parameters in XML/VB Script custom component

    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...
  14. Programmer1974

    making parameters optional in custom VB component

    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...
  15. Programmer1974

    making parameters optional in custom VB component

    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...
  16. Programmer1974

    Minimize or hide this DOS window

    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
  17. Programmer1974

    Sending Word Doc as Email TextBody

    Good job dmears1! Where did you find documentation on objMessage.CreateMHTMLBody That's a new one for me??? Thanks!
  18. Programmer1974

    Variable scope with .wsf scripts

    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...
  19. Programmer1974

    Variable scope with .wsf scripts

    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...
  20. Programmer1974

    Pass Variable to 2nd script, process and return

    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"...

Part and Inventory Search

Back
Top