I am using:
sub mysub()
dim fso as new filesystemobject, ts as textstream
set ts=fso.createtextfile("c:\temp\temp.bat"
ts.writeline "net use q: /delete"
ts.close
shell("c:\temp\temp.bat",vbhide)
end sub
The question is, how do you write a batch file so that it forces a disconnect, even if files from the share are open? Currently if files are open, I get an MS-DOS dialog box that alerts the user to the open files, and asks them if they would still like to disconnect.
I've tried:
sub mysub()
dim fso as new filesystemobject, ts as textstream
set ts=fso.createtextfile("c:\temp\temp.bat"
ts.writeline "net use q: /delete:yes"
ts.close
shell("c:\temp\temp.bat",vbhide)
end sub
but this doesn't work.
Is there a way to make it so that the disconnect occurs regardless, i.e., so that the batch file, when it would otherwise prompt the user to confirm the disconnect in spite of open files, defaults to "YES"?
Thanking you in advance, Mike K
sub mysub()
dim fso as new filesystemobject, ts as textstream
set ts=fso.createtextfile("c:\temp\temp.bat"
ts.writeline "net use q: /delete"
ts.close
shell("c:\temp\temp.bat",vbhide)
end sub
The question is, how do you write a batch file so that it forces a disconnect, even if files from the share are open? Currently if files are open, I get an MS-DOS dialog box that alerts the user to the open files, and asks them if they would still like to disconnect.
I've tried:
sub mysub()
dim fso as new filesystemobject, ts as textstream
set ts=fso.createtextfile("c:\temp\temp.bat"
ts.writeline "net use q: /delete:yes"
ts.close
shell("c:\temp\temp.bat",vbhide)
end sub
but this doesn't work.
Is there a way to make it so that the disconnect occurs regardless, i.e., so that the batch file, when it would otherwise prompt the user to confirm the disconnect in spite of open files, defaults to "YES"?
Thanking you in advance, Mike K