Hello all
I want to delete a file which is not placed on my local machine, it is placed on diffrent machine but in the same network. How can i delete that file , i am using VBScript -ASP
Thanks in advanced
9 11739
Hi,
Use Filesystemobject to deal with the files.
e.g. - <%
-
-
Dim fso
-
Dim filename
-
set fso = Server.CreateObject("Scripting.FileSystemObject")
-
-
''''Path of the file to be deleted
-
filename = "\example.txt"
-
-
'''Check if file exists before deleting
-
-
If fso.FileExists(filename) then
-
''''Delete the file
-
fso.DeleteFile(filename)
-
else
-
Response.write("File does not exists")
-
end if
-
set fso = nothing
-
%>
Hello all
I want to delete a file which is not placed on my local machine, it is placed on diffrent machine but in the same network. How can i delete that file , i am using VBScript -ASP
Thanks in advanced
Hi Shweta
Thanks For The quick Reply,i have tried your code it will run fine if my file is on the local system,but I have to delete a file which is placed on some other system but both system are in same network.
Hi,
Use Filesystemobject to deal with the files.
e.g. - <%
-
-
Dim fso
-
Dim filename
-
set fso = Server.CreateObject("Scripting.FileSystemObject")
-
-
''''Path of the file to be deleted
-
filename = "\example.txt"
-
-
'''Check if file exists before deleting
-
-
If fso.FileExists(filename) then
-
''''Delete the file
-
fso.DeleteFile(filename)
-
else
-
Response.write("File does not exists")
-
end if
-
set fso = nothing
-
%>
Hi,
If the file is located on the remote machine then give the full path of the filename.
e.g.
If the file is located on the remote machine with the name "remote-machine"
then full path will be //remote-machine/filename or if you dont know the machine name on the remote system you can also use IP address of the machine you want to access.
Hi Shweta
Thanks For The quick Reply,i have tried your code it will run fine if my file is on the local system,but I have to delete a file which is placed on some other system but both system are in same network.
I have tried with IP Address as well as Machine name but error comes like netwrok path not found,infact network path is correct. I have tried it as follow -
Dim objFSO,filename
-
Set objFSO = CreateObject("Scripting.FileSystemObject")
-
objFSO.DeleteFile "\\\\192.168.2.241\\c:\\test.txt",true
-
But i got error like Network Path was not found same in the case of Machine name
Hi,
If the file is located on the remote machine then give the full path of the filename.
e.g.
If the file is located on the remote machine with the name "remote-machine"
then full path will be //remote-machine/filename or if you dont know the machine name on the remote system you can also use IP address of the machine you want to access.
Hi,
Try to give path like this :
objFSO.DeleteFile "\\192.168.2.241\test.txt",true
OR
objFSO.DeleteFile "\\machinename\test.txt",true
I have tried with IP Address as well as Machine name but error comes like netwrok path not found,infact network path is correct. I have tried it as follow -
Dim objFSO,filename
-
Set objFSO = CreateObject("Scripting.FileSystemObject")
-
objFSO.DeleteFile "\\\\192.168.2.241\\c:\\test.txt",true
-
But i got error like Network Path was not found same in the case of Machine name
Hi have already tried like you told but i got error "File Not Found"
Please help me out from this
Hi,
Try to give path like this :
objFSO.DeleteFile "\\192.168.2.241\test.txt",true
OR
objFSO.DeleteFile "\\machinename\test.txt",true
someone recently told me you have to use wscript.shell (I'm not sure if I spelled that right) to do that, but I have never tried. I think it works similar to scripting.fileSystemObject
Jared
Hi shweta,
Thanks a lot your code working fine now,Previously i forgot to enable "full control" attribute of that file without which we cant delete remote file.
Thanks a lot.
Bye Take care
Hi,
Try to give path like this :
objFSO.DeleteFile "\\192.168.2.241\test.txt",true
OR
objFSO.DeleteFile "\\machinename\test.txt",true
Hi,
Use Filesystemobject to deal with the files.
e.g. - <%
-
-
Dim fso
-
Dim filename
-
set fso = Server.CreateObject("Scripting.FileSystemObject")
-
-
''''Path of the file to be deleted
-
filename = "\example.txt"
-
-
'''Check if file exists before deleting
-
-
If fso.FileExists(filename) then
-
''''Delete the file
-
fso.DeleteFile(filename)
-
else
-
Response.write("File does not exists")
-
end if
-
set fso = nothing
-
%>
Hi,
I need open the file in different system.How can i open that file in my system.There systems are all in local network.Please send me the solution asap.it is developing the applications in .net
Thanks a lot.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jennifer Smith |
last post by:
Currently we have a site that allows users to listen to mp3 files. It
is creating bandwidth issues. So we want to move the mp3 files to an
ISP that caps bandwidth usage. Ours is currently...
|
by: iqbal |
last post by:
Hi all,
We have an application through which we are bulk inserting rows into a
view. The definition of the view is such that it selects columns from
a table on a remote server. I have added the...
|
by: Daniel |
last post by:
when i use stream writer to write to a shared folder, and the network card
of that remote computer is disabled in the middle of the write then
reenabled later. every time i try to write to that...
|
by: bettervssremoting |
last post by:
To view the full article, please visit
http://www.BetterVssRemoting.com
Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere
and VSS Remoting
This article makes a detailed...
|
by: =?Utf-8?B?TVNU?= |
last post by:
To demonstrate my problem, I have a very simple VB Windows application. It
has a text box that is used to display a counter, a button to reset the
counter, and a timer that increments the counter...
|
by: sphinney |
last post by:
All,
I'm not sure how to adequately explain my problem in two sentences or less, so at the risk of providing TMI, here's the condensed verion.
I have developed an Access 2002 database file that...
|
by: =?Utf-8?B?U2FsYW1FbGlhcw==?= |
last post by:
Has anybody worked with performancecounter object to access counters on
remote machine?
I managed to write code that retrieves counters categories froma remote
machine, when I try another remote...
|
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= |
last post by:
Hello!
I'm trying to copy a file from another computer on the network that I do not
have permission with my current logon details to access.
If I open the folder using the Windows file manager...
|
by: limperger |
last post by:
Hello everyone! I do not know if it is possible to do something like this in Access but let me try to ask: Is there any way to insert in an Access field a shortcut to an office file, being all the...
|
by: luker |
last post by:
Hello Experts,
I am writing an application for a device running windows xp embedded. I want to code on my developer pc and deploy the running executable to the embedded device.
- The two boxes...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |