SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    87
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Run a DOS command (without opening cmd window)

    How do you get a script or function to run a dos command without acutally opening the dos command window?

    Thanks in advance

  2. #2
    Member
    Join Date
    Dec 2001
    Location
    Baton Rouge, LA, USA
    Posts
    407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Run a DOS command (without opening cmd window)

    What exactly are you trying to do? Move a folder or run a bat?
    Robby
    Geaux LSU

  3. #3
    Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    87
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Run a DOS command (without opening cmd window)

    In Windows 2000, overwrite the contents of one folder with the contents of another folder, but would like to do it silently i.e. no DOS windows appearing at any time

    Try this command for example,
    XCOPY "C:\Archive1 C:\Archive2 /S/E/Y"

    This can be done with SQAShellExecute by locating the directory path for cmd.exe, then executing cmd.exe to produce a DOS window. Once the DOS window appears you can use SQA's Inputkeys to run the XCOPY command outlined above.

    Very messy though!!! Must be slicker way than this surely.

  4. #4
    Member
    Join Date
    Dec 2001
    Location
    Baton Rouge, LA, USA
    Posts
    407
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Run a DOS command (without opening cmd window)

    You can try this window does come up but very quickly
    startapplication "XCOPY C:\Archive1 C:\Archive2 /S/E/Y"
    delayfor "1000"
    Robby
    Geaux LSU

  5. #5
    Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    87
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Run a DOS command (without opening cmd window)

    Sorry Robby, I don't follow! Probably missing something...as usual :-)

    Correct me if I am wrong but isn't SQA's startApplication used to simply start a application? How does it tie in with running a dos window command such as XCOPY in silent mode?

  6. #6
    Senior Member
    Join Date
    Oct 2001
    Location
    Presov, Slovakia
    Posts
    201
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Run a DOS command (without opening cmd window)

    I'm using for overwriting the contents of one folder with the contents of another folder function FileSysObjAction("COPYFOLDER","",""), which you can find in FileSysUtils in yahoo group "RationalUsers".

    Code below is from this function:

    Dim objFSO as Object

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    'args: source, target, overwrite (no wildcards in target)
    'returns true if successful
    On Error Resume Next
    Result = objFSO.CopyFolder(vArg1, vArg2, TRUE)
    If Err = 440 Then
    'TO-DO: additional err handlg (test for src folder, is target path valid, etc.)
    MsgBox "FUNC FileSysObjAction: CopyFile. Probable invalid argument:" _
    & Chr(10) & "Source = " & vArg1 & "; Target = " & vArg2
    End If
    If you want to give somebody a fish, you'll do better if you teach him how to catch it.

    Marek Fric
    ICQ# 114486928

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:02 AM.

Copyright BetaSoft Inc.