Link to home
Start Free TrialLog in
Avatar of TheVeee
TheVeeeFlag for United States of America

asked on

VB 6 Example of deleting a file on a remote computer

Last job wrote a program to logon to another server, delete a file in a certain directory.  Unfortunely didnt bring code to new job.  Does anyone have a example of connecting to a server using a certain userid and password and then deleting a file from a directory?
Avatar of Mayank S
Mayank S
Flag of India image

Are you looking for a  VB 6 example? If so why did you post it in the Java forum?

If you're looking for a Java example, you can use the java.io.File class:

File f = new File ( "Shared file path" ) ;

if ( f.exists () )
  f.delete () ;
Avatar of TheVeee

ASKER

I can write it with either language.. just wanted the best solution from both worlds to make my choice...

You're example takes it a a granted your logged in and mapped to the drive.. I wont be.  We support 40 servers so I just dont want to map all 40 servers to my local machine.  Im looking for something like...

1.  From my machine run the application
2.  For each machine do the following
     a.  Log onto remote server using a generic userid and password
     b.  Then do you code from above.
     c.  Then Log off remote server
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial