473,941 Members | 22,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rename a file

tom
Hello, got a prob with renaming a file; still don't know where is the
mistake.
this is the code:
<%
'************** *************** *************** *************** *************** *
*
file_orig=sessi on("nome_file" )
file_copy=sessi on("id_risp") & "_" & session("id_rec l")
'path_copy=Serv er.Mappath("/document/" & file_copy & ".doc")

'response.write (file_orig)&"<b r>"
'response.write (file_copy)&"<b r>"
'response.end

Dim fso
set fso = Server.CreateOb ject("Scripting .FileSystemObje ct")
fso.MoveFile file_orig, file_copy <--( ROW: 117 )
set fso = nothing
%>
and this is the Error :

Microsoft VBScript runtime error '800a0035'

File not found

/aaaa/bbbb/zzzz/frm_risp_new_sq l.asp, line 117

Have u got any clue?
Jul 21 '05
17 2107
tom
Sorry about my english, bob.
I just tried to say, that my first problem is concerning about
renaming a file rather than find out more about the path.
Of course Aaron is right when he says that first I should
sort out with the path.
however I don't know how to behave in this case cause
is a brand new stuff for me, if could give me some advice,
would be appriciated.
thanks

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:eY******** ******@TK2MSFTN GP14.phx.gbl...
Maybe was a thought of mine cares about the path, but actually is not
my first problem cause ,

<snip>

Huh???

Could you rewrite that please? In English? I've read it twice and I still
haven't the slightest idea about what you're trying to say.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 21 '05 #11
Uh-oh. You're not a native English speaker? If so, my apologies. I was
assuming you were being lazy, instead of having problems expressing yourself
in a different language.

However, I'm still having difficulties understanding what your problem is.
Hopefully someone else can help.

Bob Barrows
tom wrote:
Sorry about my english, bob.
I just tried to say, that my first problem is concerning about
renaming a file rather than find out more about the path.
Of course Aaron is right when he says that first I should
sort out with the path.
however I don't know how to behave in this case cause
is a brand new stuff for me, if could give me some advice,
would be appriciated.
thanks

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:eY******** ******@TK2MSFTN GP14.phx.gbl...
Maybe was a thought of mine cares about the path, but actually is
not my first problem cause ,

<snip>

Huh???

Could you rewrite that please? In English? I've read it twice and I
still haven't the slightest idea about what you're trying to say.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 21 '05 #12
Simply hard-code all the values first, and get that working.

c:\origfile.txt

c:\destfile.txt

Jeff

"tom" <tg***@libero.i t> wrote in message
news:#S******** *****@TK2MSFTNG P11.phx.gbl...
Sorry about my english, bob.
I just tried to say, that my first problem is concerning about
renaming a file rather than find out more about the path.
Of course Aaron is right when he says that first I should
sort out with the path.
however I don't know how to behave in this case cause
is a brand new stuff for me, if could give me some advice,
would be appriciated.
thanks

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:eY******** ******@TK2MSFTN GP14.phx.gbl...
Maybe was a thought of mine cares about the path, but actually is not
my first problem cause ,

<snip>

Huh???

Could you rewrite that please? In English? I've read it twice and I still haven't the slightest idea about what you're trying to say.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jul 21 '05 #13
Okay, here it is in plain English.

fso.MoveFile test.txt test2.txt is BAD!
fso.MoveFile c:\test.txt c:\test2.txt is GOOD. c:\test.txt MUST EXIST.

You must pass fully-qualified file name to MoveFile and the source file must
exist.

Paul

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:u4******** ******@TK2MSFTN GP09.phx.gbl...
Uh-oh. You're not a native English speaker? If so, my apologies. I was
assuming you were being lazy, instead of having problems expressing yourself in a different language.

However, I'm still having difficulties understanding what your problem is.
Hopefully someone else can help.

Bob Barrows
tom wrote:
Sorry about my english, bob.
I just tried to say, that my first problem is concerning about
renaming a file rather than find out more about the path.
Of course Aaron is right when he says that first I should
sort out with the path.
however I don't know how to behave in this case cause
is a brand new stuff for me, if could give me some advice,
would be appriciated.
thanks

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:eY******** ******@TK2MSFTN GP14.phx.gbl...
Maybe was a thought of mine cares about the path, but actually is
not my first problem cause ,
<snip>

Huh???

Could you rewrite that please? In English? I've read it twice and I
still haven't the slightest idea about what you're trying to say.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 21 '05 #14
:-)
Sure, but others, including Aaron have said that. How does that address the
rest of his concerns (whatever they are)? He seems to have some sort of
objection to using the path that I just don't understand. Do you?

Bob

Paul Baker [MVP, Windows - SDK] wrote:
Okay, here it is in plain English.

fso.MoveFile test.txt test2.txt is BAD!
fso.MoveFile c:\test.txt c:\test2.txt is GOOD. c:\test.txt MUST EXIST.

You must pass fully-qualified file name to MoveFile and the source
file must exist.

Paul

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:u4******** ******@TK2MSFTN GP09.phx.gbl...
Uh-oh. You're not a native English speaker? If so, my apologies. I
was assuming you were being lazy, instead of having problems
expressing yourself in a different language.

However, I'm still having difficulties understanding what your
problem is. Hopefully someone else can help.

Bob Barrows
tom wrote:
Sorry about my english, bob.
I just tried to say, that my first problem is concerning about
renaming a file rather than find out more about the path.
Of course Aaron is right when he says that first I should
sort out with the path.
however I don't know how to behave in this case cause
is a brand new stuff for me, if could give me some advice,
would be appriciated.
thanks

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:eY******** ******@TK2MSFTN GP14.phx.gbl...
> Maybe was a thought of mine cares about the path, but actually is
> not my first problem cause ,
<snip>

Huh???

Could you rewrite that please? In English? I've read it twice and I
still haven't the slightest idea about what you're trying to say.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 21 '05 #15
Bob,

No, I don't understand. I was trying to just reiterate everyone else's good
advice as clearly and concisely as possible.

If he is renaming a file, it has to exist and he has to know what the file
name is. Nothing else makes sense, and the other IIS related details seem
kind of irrelevant.

Paul

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uM******** ******@TK2MSFTN GP15.phx.gbl...
:-)
Sure, but others, including Aaron have said that. How does that address the rest of his concerns (whatever they are)? He seems to have some sort of
objection to using the path that I just don't understand. Do you?

Bob

Paul Baker [MVP, Windows - SDK] wrote:
Okay, here it is in plain English.

fso.MoveFile test.txt test2.txt is BAD!
fso.MoveFile c:\test.txt c:\test2.txt is GOOD. c:\test.txt MUST EXIST.

You must pass fully-qualified file name to MoveFile and the source
file must exist.

Paul

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:u4******** ******@TK2MSFTN GP09.phx.gbl...
Uh-oh. You're not a native English speaker? If so, my apologies. I
was assuming you were being lazy, instead of having problems
expressing yourself in a different language.

However, I'm still having difficulties understanding what your
problem is. Hopefully someone else can help.

Bob Barrows
tom wrote:
Sorry about my english, bob.
I just tried to say, that my first problem is concerning about
renaming a file rather than find out more about the path.
Of course Aaron is right when he says that first I should
sort out with the path.
however I don't know how to behave in this case cause
is a brand new stuff for me, if could give me some advice,
would be appriciated.
thanks

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:eY******** ******@TK2MSFTN GP14.phx.gbl...
>> Maybe was a thought of mine cares about the path, but actually is
>> not my first problem cause ,
> <snip>
>
> Huh???
>
> Could you rewrite that please? In English? I've read it twice and I
> still haven't the slightest idea about what you're trying to say.
>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 21 '05 #16
Tom
this is the actual situation:
I've got a form with 3(+1) fields
0.ID(hidden)
1.Date(irreleva nt)
2.Title(irrelev ant)
3.File to upload -> Now everytime somebody's going to upload the original
file, the file itself keeps the original name.So at this point I would
change
this name with another one which is the union between the first ID and the
ID
of another table separated by a "_" (example -> "32_15.doc" instead of
"pippo.doc" ).
I 'm doing this cause I'd like to avoid to overwrite a file.

For what concerns the path instead I still have difficulties to understand
how it works.
cause if am extracting the file's path I get the path of my local computer
which is:
C:\prog\......\ document\32_15. doc
I dont know if it is right cause am working straight on the server and not
on my local
PC. So I dont really know if it should have a different path or what. for
example
ip_number\fold_ 1\fold_2\....fo ld_n\document\3 2_15.doc??

Let me know, cheers


"Paul Baker [MVP, Windows - SDK]" <pa***@online.r ochester.rr.com > wrote in
message news:eY******** ******@TK2MSFTN GP12.phx.gbl...
Bob,

No, I don't understand. I was trying to just reiterate everyone else's good advice as clearly and concisely as possible.

If he is renaming a file, it has to exist and he has to know what the file
name is. Nothing else makes sense, and the other IIS related details seem
kind of irrelevant.

Paul

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uM******** ******@TK2MSFTN GP15.phx.gbl...
:-)
Sure, but others, including Aaron have said that. How does that address

the
rest of his concerns (whatever they are)? He seems to have some sort of
objection to using the path that I just don't understand. Do you?

Bob

Jul 21 '05 #17
Tom,

You have to figure out if the source file exists on the server or not. If
not, how are you going to debug it? Is someone restricting your access to
the server?

Paul

"Tom" <tg***@libero.i t> wrote in message
news:ez******** ******@TK2MSFTN GP14.phx.gbl...
this is the actual situation:
I've got a form with 3(+1) fields
0.ID(hidden)
1.Date(irreleva nt)
2.Title(irrelev ant)
3.File to upload -> Now everytime somebody's going to upload the original
file, the file itself keeps the original name.So at this point I would
change
this name with another one which is the union between the first ID and the
ID
of another table separated by a "_" (example -> "32_15.doc" instead of
"pippo.doc" ).
I 'm doing this cause I'd like to avoid to overwrite a file.

For what concerns the path instead I still have difficulties to understand
how it works.
cause if am extracting the file's path I get the path of my local computer
which is:
C:\prog\......\ document\32_15. doc
I dont know if it is right cause am working straight on the server and not
on my local
PC. So I dont really know if it should have a different path or what. for
example
ip_number\fold_ 1\fold_2\....fo ld_n\document\3 2_15.doc??

Let me know, cheers


"Paul Baker [MVP, Windows - SDK]" <pa***@online.r ochester.rr.com > wrote in
message news:eY******** ******@TK2MSFTN GP12.phx.gbl...
Bob,

No, I don't understand. I was trying to just reiterate everyone else's

good
advice as clearly and concisely as possible.

If he is renaming a file, it has to exist and he has to know what the file name is. Nothing else makes sense, and the other IIS related details seem kind of irrelevant.

Paul

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:uM******** ******@TK2MSFTN GP15.phx.gbl...
:-)
Sure, but others, including Aaron have said that. How does that address
the
rest of his concerns (whatever they are)? He seems to have some sort

of objection to using the path that I just don't understand. Do you?

Bob


Jul 21 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
9563
by: Tom | last post by:
I'm having a problem using a path with spaces as a parameter to os.rename() in a program on WinXP. This works fine at the command line (where the folder "c:\aa bb" exists) > os.rename( "c\aa bb", "c:\cc dd" ); > But, I can't get it to work in my program, eg.
5
2766
by: jez123456 | last post by:
Hi, I’ve written a c# program to compact certain msaccess databases. The way this works is to compact say C:\test1.mdb to C:\temp.mdb, then delete C:\test1.mdb and rename C:\temp.mdb as C:\test1.mdb. My problem occurs if there is already a C:\temp.mdb file. I don’t want to just delete this, as it could have been created separately by a user. In my code, I set a constant as follows: private const string tempMdb = @"C:\temp.mdb";
1
2017
by: Jay at SCA | last post by:
I've been having the following issue with a windows service I've created in vb.net (.net fw 1.1): Basically, my service monitors a folder for the creation of any new files of a particular type and renames them using the "Rename(oldfilename,newfilename)" function. Unfortunately, this function only seems to work if and only if it is preceeded by a 'msgbox("<some text>")'. ie. If I have the following the service sees the file
2
2979
by: Bruce Russell | last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the solution explorer. The file is located in my local web server at C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx Is there some configuration problem in my IIS setup? Thanks,
5
4473
by: Rothariger | last post by:
Hello.... i want to know if its posible to rename multiple files like windows does.. example: file zzzzzzz.doc file asdasd.doc file esfsefse.doc
5
2743
by: Tony Meyer | last post by:
On Windows, if I do os.rename(old, new) where old is a file that is in-use (e.g. python itself, or a dll that is loaded), I would expect that an error would be raised (e.g. as when os.remove is called with an in-use file). However, what happens is that a copy of the file is made, and the old file still exists. For example: C:\>c:\python24\python.exe Python 2.4.2 (#67, Sep 28 2005, 12:41:11) on win32
5
3068
by: VB Programmer | last post by:
My web hoster says that I have to rename my ASPNETDB.MDF SqlExpress db for my 2.0 site to work. Is this accurate? If so, how can I rename it without breaking anything on my site? FYI: This is the error I'm getting after I publish my site to their servers... An attempt to attach an auto-named database for file c:\hosting\myhost\member\myaccount\customerdomains\mysite\App_Data\ASPNETDB.MDF failed. A database with the same name exists,...
12
2923
by: mantrid | last post by:
Im trying to move a file but am having luck my code is below. The temp and target paths are valid as they echo correctly. but I cant get the copy() function to work, or the rename() function $target_path = $targetdir . basename($uploadedfile); $temp_path = $tempdir. basename($uploadedfile); echo "Target - ".$target_path." Temp - ".$temp_path."<br>";
1
4529
by: spacehopper_man | last post by:
no "rename" operation in C# !!! - this has been covered in this group before, but I can't find any good answers. what I am trying to do is refresh the content in a file with minimum performance impact on any read operations to that file - a common task right.... in the unix world the way to do this is to create a temporary file with
2
3647
by: =?iso-8859-1?b?cultaQ==?= | last post by:
Hi, I would like to rename files (jpg's ones) using a text file containing the new names... Below is the code that doesn't work : ***** #!/usr/bin/python #-*- coding: utf-8 -*- from os import listdir, getcwd, rename import re
0
11530
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11113
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11296
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9858
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6080
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6298
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4450
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.