Re: VBscript Search and Replace conundrum

From: Roland Hall (nobody_at_nowhere)
Date: 03/15/05

  • Next message: Taavi Sepp: "Windows domain login scripts"
    Date: Tue, 15 Mar 2005 15:50:00 -0600
    
    

    "O.G." <aogilmore@sbcglobal.net> wrote in message
    news:1110914749.781720.134250@l41g2000cwc.googlegroups.com...
    Sure, here is what the INI files look like:

    [Digital_Save]
    ; mode=MCI (default)
    ; mode=ActiveMovie
    mode=MCI
    drive=C:\United\VWCMI\DATA

    Is this the C: being replaced?

    >> Why do you have this in your for...loop?
    >> If UCase(Right(WScript.FullName, Len(WScript.FullName) -
    >> InStrRev(WScript.FullName,"\")­)) <> "CSCRIPT.EXE" Then
    >> Set wshShell = WScript.CreateObject("WScript.­Shell")
    >> wshShell.Run

    To tell the truth, I cribbed this from somebody else's search/replace
    program, and then cobbled together some WMI stuff to determine logical
    drive. There probably is a better way of doing it, as you indicate...

    Ok, if this is a timing issue, verifying the script is being called with
    cscript instead of wscript, and making a call to run it in a shell, would
    definitely be a timing issue. Unless you check the shell for a return, the
    script will continue regardless of what is happening in the shell. If you
    want to keep this, I would put it near the top outside of the For...Next
    loop.

    -- 
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but 
    without any warranty; without even the implied warranty of merchantability 
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    

  • Next message: Taavi Sepp: "Windows domain login scripts"

    Relevant Pages

    • Re: detect shell script language
      ... In the 'old' days, when a user typed in a command, the interactive shell would immediately pass it off to 'exec' to execute. ... So, on return from exec with an error status, the shell would fork a copy of itself to try and run the script. ... As a result of the above, it was hard to tell whether the script was a Bourne shell or C shell, so the convention was introduced of using the Bourne shell no op command, as the first line in a Bourne shell script. ...
      (Debian-User)
    • Re: Call for input on comp.unix.shell FAQ
      ... >> questions and just tell people to FAQ it. ... The other level is how to write shell scripts. ... How can I remove whitespace characters within file names? ... Why one shouldn't use "echo" in a script? ...
      (comp.unix.shell)
    • SHELLdorado Newsletter 1/2003 - July 6th, 2003
      ... The "SHELLdorado Newsletter" covers UNIX shell script related ...
      (comp.unix.shell)
    • Re: Affecting Institutional Change (Yeah Right)
      ... provides labs in most non-dorm buildings replete with the wonderful ... be run from a shell, no idea what an executable was, and, in fact, ... IDE program, go through a ton of menus to pick the right script, go ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • SHELLdorado Newsletter 1/2003 - July 6th, 2003
      ... The "SHELLdorado Newsletter" covers UNIX shell script related ...
      (comp.unix.admin)