Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, net use command, locked files, and sub-processes in Windows; Hi, Sometimes the "net use /d Z:" command returns: There are open files and/or incomplete directory searches pending on the ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=19662


Reply
LinkBack Thread Tools Display Modes
net use command, locked files, and sub-processes
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
21-01-2009, 04:30 PM
 
Hi, Sometimes the "net use /d Z:" command returns: There are open files and/or incomplete directory searches pending on the connection to Z: Is it OK to continue disconnecting and force them closed? (Y/N) [N]: I want to use this command in...

Hi,

Sometimes the "net use /d Z:" command returns:

There are open files and/or incomplete directory searches pending on the connection to Z:
Is it OK to continue disconnecting and force them closed? (Y/N) [N]:

I want to use this command in a script and automatically supply Y.
I have discovered the following 2 things:

1. The following does NOT work with net use either from a command window or in a DOS bat file:
net use /d Z: < y.dat
where y.dat contains Y followed by a newline character.

2. The following, however, does work both from a command window and from a DOS bat file
echo Y | net use /d Z:

However, I am trying to do this from a Perl script.
Neither of the following system calls work:
system ("echo Y | /d Z:");"
nor
`"echo Y | /d Z:"`
(I have also tried escaping the pipe character, i.e. tried using \|.

Apparently piping does not work in sub-processes.
Anyone have any suggestions for how I might get this to work?

Thanks for any help you can give.
Andy
 
 
 
Reply

Articles Thread, net use command, locked files, and sub-processes in Windows; Hi, Sometimes the "net use /d Z:" command returns: There are open files and/or incomplete directory searches pending on the ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=19662


Bookmarks

Tags
command, files, locked, net, subprocesses


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump