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 
18:14:36
    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 Command.com
'    pState = Shell("command.com  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 
file
    '  LOOK.DIR contains QUOTE
    'Specified COMMAND search directory bad
    'Too many parameters
    'Microsoft(R) Windows DOS
    '(C)Copyright Microsoft Corp 1990-2001.
    'C>exit
    '  UNQUOTE
        ''  So, try a mod..
'    pState = Shell("command.com < 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.
    
    Stop
    Print #1, DaTm + " to " + vNam
    Close


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 @ 
https://www.facebook.com/discussexcel

FORUM RULES

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 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to