WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Traversing Network Neighborhood with AskFileName and w95Resources

Keywords:    AskFileName    w95Resources

Question:

I am wanting to process data found in directories on other machines in my Network Neighborhood.

I have a dialog box which allows mw to browse directories but it only does it in Windows 3.1 fashion. I need to go up to the Desktop level and them come down to the machine/directory of my choice.

The only WIL function that appears to do this is AskFileName but this doesn't allow me to return a directory name only despite using IntControl(4,0,0,0,0).

Can this be done with my NT 4.0 machine?

Answer:

  1. You can do it with AskFileName, but you have to select a file (Which can then be ignored). NB: Intcontrol(4,...) is just for the DIALOG function.

  2. Using w95Resources or wntResources you can build an AskItemList of an ItemBox in a dialog to work this out for you.
;Win32 Net Example
ResourceRoot=""
ScopeConnectted=1
ScopeAll=2
ScopePersistant=3
TypeAll=0
TypeDisk=1
TypePrint=2
TypeDiskAndPrint=3
UsageAll=0
UsageConnectable=1
UsageContainer=2
UsageConnAndCont=4
oncancel="exit"
AddExtender(strcat(DirHome(),"WWW9534I.DLL"))
aaa=ResourceRoot
aaalist=w95Resources(aaa, ScopeAll, TypeAll, UsageAll)
level=0

while 1
   aaa%level%=aaa
   if level==0 then ButtonNames("Down","Exit")
	       else ButtonNames("Down","Up")
   level=level+1
   goto downalevel
   
   :upalevel
   if level==0 then exit
   level=level-1
   if level==0 then ButtonNames("Down","Exit")
	       else ButtonNames("Down","Up")
   aaa=aaa%level%
   
   :downalevel
   oncancel="goto upalevel"
   aaalist=w95Resources(aaa, ScopeAll, TypeAll, UsageAll)
   aaa=AskItemList("Resource Viewer",aaalist,@tab,@sorted,@single)

endwhile
exit
:CANCEL
%oncancel%
exit

Article ID:   W13191
Filename:   Traversing Network Neighborhood using AskFileName.txt
File Created: 2001:03:01:14:40:30
Last Updated: 2001:03:01:14:40:30