Results 1 to 10 of 10
  1. #1
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Batch File to start apps (SP2)

    In Win98, I had a batch file made as follows:
    1. Create a folder & give it the name IntStart.
    2. Right click the desktop & choose New/Shortcut.
    3. For the command line, use
    C:WINDOWSsystem32COMMAND.COM /C FOR %%V IN (C:IntStart*.*) DO START %%V
    4. Click OK. The shortcut will now have an MS-DOS shorcut icon.
    5. Right click & choose Properties/Program tab.
    6. Choose "Close on exit" & Run: "Minimized".

    When I try to do the same thing in WinXP, I get a message that
    Cannot load VDM IPX/XPS Support
    & it doesn't work. I realize that DOS doesn't exist in XP, but can't the same thing be done with command.com? The above command line won't work for the shortcut.
    Thanks for any help.

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File to start apps (SP2)

    What have you got in C:IntStart ?

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File to start apps (SP2)

    Hi Leif:
    I have shortcuts to two apps: Smartboard 2K & WordWeb (a dictionary). Under Win98, the advantage of using this method was that whatever I put in the folder C:IntStart would be started when I ran the batch file. If I no longer wanted it part of the batch file, I simply deleted the shortcut.

  4. #4
    Silver Lounger
    Join Date
    Apr 2001
    Location
    New York, New York, USA
    Posts
    2,328
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File to start apps (SP2)

    Dear Phil,

    The major difference between Windows 95/98/ME and Windows NT/2000/XP that the latest do not use DOS ("real DOS"). They have DOS-like command prompt, but it is NOT a DOS prompt. That's why Windows shortcuts (.lnk) couldn't be run from command prompt (by command.com).

    The workaround is: create a VBS file to run your programs. For example, like this:

    ' ************************************************** ******
    On Error Resume Next
    Dim WSHShell
    Set WSHShell = WScript.CreateObject("WScript.Shell")

    WSHShell.Run ("C:IntStartSmartboard 2k.lnk")
    WSHShell.Run ("C:IntStartWordWeb.lnk")
    ' ************************************************** ******

    Create a new text file, copy-paste the commands above to it, change the names of shortcuts to real ones and "save as" the file with .vbs extension.

    Maybe somebody else can modify this script using For... Each loop (I don't know how to stop the loop)? Please!

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File to start apps (SP2)

    Hi kaplinb:
    Thanks for this information. I haven't uses a VBS script (except those written by others). Do you think if I used
    ****************************
    On Error Resume Next
    Dim WSHShell
    Set WSHShell = WScript.CreateObject("WScript.Shell")

    WSHShell.Run ("C:IntStart*.*")
    *********************************************

    that it would start every application whose shortcut was in the C:IntStart folder...or would I get some endless loop? I suppose I could experiment. <img src=/S/devil.gif border=0 alt=devil width=15 height=15> Actually, I just tried it & it didn't work (my version). Do you know of a way to have either a VBS file or batch that would start whatever shortcuts I put in the folder?
    Thanks again,

  6. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File to start apps (SP2)

    Phil

    I'm not sure if my situation matches yours in any way, but I have a desktop icon = shortcut to a BATch file (called $CALLER$.BAT, since you ask). This file is (optionally) clickable, and is scheduled to run once a day. Within that BATch file I call a number of further BATch files which do various forms of backup, as follows:

    call c:batOEQckBkp
    call c:batOERegBkp
    call c:batCopyCtoE

    If I want another type of backup (e.g. to save the information from ASSOC and FTYPE, or to export the Registry to a file -- next two projects!) I would write a BATch file for each, and just add it to the CALL statements in the $CALLER$.BAT file.

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File to start apps (SP2)

    Hi John:
    Thanks for this. I may have to resort to a technique like that. What I would like to do, though, is have a batch file (clickable) that would start any app whose shortcut is in the folder C:IntStart. That way, I could make additions or deletions to what is started simply by adding or removing a shortcut from C:IntStart. Is this possible in WinXP?

  8. #8
    Silver Lounger
    Join Date
    Apr 2001
    Location
    New York, New York, USA
    Posts
    2,328
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File to start apps (SP2)

    Phil,
    That's what you need:

    '************************************************* *
    Dim WSHShell
    Set WSHShell = WScript.CreateObject("WScript.Shell")
    Dim FSO
    Set FSO = CreateObject("Scripting.FileSystemObject")

    DoDir FSO.GetFolder("C:IntStart")
    Sub DoDir(Folder)
    On Error Resume Next
    Dim File
    For Each File In Folder.Files
    WSHShell.Run(File)
    Next
    End Sub
    '*************************************************

    I tested it, it works. It needs no adjustments - just save it as VBS file.

    Regards,

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File to start apps (SP2)

    Hi kaplinb:
    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>!! That works great. I really appreciate it. I know less about vbs files than about DOS. I take it that shortcuts that have a space in the name won't work (per my experiments), but that's not really a problem, since eliminating the space is easy.
    <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

  10. #10
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File to start apps (SP2)

    Phil

    I have never seen your "lnk" technique used anywhere, possibly because I concentrate on BATch files...! Since .LNK files are not, strictly speaking, executable by the ComManD processor, I'm surprised you ever got them to work in Windows 98...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •