Following is a true copy of Windows VP SP3 EXCEL 2010 program where each 
attempt is seen,
    line begins "pSTATE.." and commented out for next attempt.

 NO previous suggestions worked.
Sub TestDIR()

' Macro recorded 04/12/2018 by ROBERT BAER

    pPath = "G:\ANALOG"
    DaTm = Date$ + " " + Time$  'Present date and time example: 04-12-2018 
    Open pPath + "Log.TXT" For Append As #1
    ' DAMN "default" directory "My Documents" is used
    '' This gives "File not found"
'    pState = Shell("DIR *.* > LOOK.DIR", vbNormalFocus)
    '' So..try Command
'    pState = Shell("command  *.* > LOOK.DIR", vbNormalFocus)
    '' This gives "File not found"
        '' So..try
'    pState = Shell("  DIR *.* > LOOK.DIR", vbNormalFocus)
    ' Well, get empty "DOS" screen with zero info and see nothing when type.
    ' Results wind up in DAMN "default" directory "My Documents" where new 
    '  LOOK.DIR contains QUOTE
    'Specified COMMAND search directory bad
    'Too many parameters
    'Microsoft(R) Windows DOS
    '(C)Copyright Microsoft Corp 1990-2001.
    '  UNQUOTE
        ''  So, try a mod..
'    pState = Shell(" < DIR *.* > LOOK.DIR", vbNormalFocus)
    ' Well, get empty "DOS" screen for about 0.5 seconds.
    ' Results wind up in DAMN "default" directory "My Documents" where file
    '  SiteBuilder.DOC got stolen from somewere (foolishly thought was copy
    '  and deleted it and info is now lost).
    ' Repeat attempts gave NO files.
        ''  So, try a different mod..
    pState = Shell("cmd.exe < DIR *.* > LOOK.DIR", vbNormalFocus)
    ' Well, get totally different screen 80 characters by 25 lines
    ' Screen shows QUOTE
    'Microsoft Windows XP [Version 5.1.2600]
    '(C) Copyright 1985-2001 Microsoft Corp.
    'C:\Documents and Settings\Robert Baer\My Documents>
    '  UNQUOTE
    ' And NO files.
    Print #1, DaTm + " to " + vNam

End Sub

  Any USEFUL suggestions?

Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @


1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
You received this message because you are subscribed to the Google Groups "MS 
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to