Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB 6 Example of deleting a file on a remote computer

Posted on 2007-03-19
3
Medium Priority
?
188 Views
Last Modified: 2010-03-31
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?
0
Comment
Question by:TheVeee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 18750147
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 () ;
0
 
LVL 5

Author Comment

by:TheVeee
ID: 18750212
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
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 2000 total points
ID: 18750406
It doesn't assume it to be mapped - you can just provide the remote path without mapping it to a drive.

You can change the user ID/ password with which you want to log on by setting it in the system properties: http://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question