473,722 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rename(old,new) issue with msgbox

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(oldfile name,newfilenam e)" 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
created in the folder and renames it appropriately:
MsgBox("e.name variable etemp is " & etemp)
Rename(etemp, NewFName) 'Rename the file

but if I comment out the 'msgbox' line and only have the
"Rename(ete mp, NewFName) 'Rename the file"
line, the service only sees the file created but does not
rename it.

I've using System.IO.File. Move(etemp, NewFName) in place
of Rename but with the same results. I'm stumped as to
why the presence of a msgbox should cause my rename to
succeed or fail.

-ANY- help in this would be greatly appreciated.

Thanks,

Jay
jg********@scf. sk.ca
Nov 20 '05 #1
1 1999
"Jay at SCA" <jg********@scf .sk.ca> wrote in news:2d2501c38e 9c$e24cc430
$3*******@phx.g bl:
I'm stumped as to
why the presence of a msgbox should cause my rename to
succeed or fail.


I would guess that the service was trying to rename the file before it was
finished being written. Adding the MsgBox may have just taken up enough
extra time to allow the file to be completely written.

Instead of using a MsgBox, try using Thread.Sleep with various amounts of
time to see if that is the case.

Just a thought

Chris
Nov 20 '05 #2

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

Similar topics

4
2477
by: F. GEIGER | last post by:
Hi again, I'd like to rename a page of a notebook. Deleting the page and adding a new one is not really an option, because the page is filled with other controls already. So I looked into Pmw.Notebook. There are quite a few lists and dicts which were to be changed and I wasn't successful in the first try. However, if nobody has ever done this, I'd have to rebuild the whole page after deleting/adding. I really hope there's an other way...
2
2310
by: N. Schultheiss | last post by:
I'm new at this and wonder if this is possible. I'm running a Win2k server with FP 2002 Extensions using discussion boards. There is a time delay in the posted content and the way our moderators are managing it now involves logging into the server, copying the TOC file, deleting the public TOC file and renaming the copy to the new public version. --Copy and paste Tocprivate.htm -> delete TocPublic.htm -> rename copy of Tocprivate.htm to...
7
9499
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.
1
9404
by: Shimon Sofer | last post by:
Hello Does anybody know how to change table name (and field name) using SQL query ? I want to use it from Delphi/ADO. Thanks
182
7529
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
5
5094
by: Bazza Formez | last post by:
Greetings... I have an odd problem to do with replacing a DLL. My ASP.NET application makes use of a 3rd party charting component. This component is supplied as a DLL file. The component has worked well for us, but now I am having real problems trying to replace the DLL with a new version.
5
2733
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
8
1956
by: Merlin | last post by:
Ok.... I feel really dumb on this one, because I had previously figured it out, and now don't have a clue. I'm trying to get the user to input a new filename (via an integer variable) and have that variable passed to rename, so that the file can be named whatever the user specifies in the console window.... Currently using
1
4518
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
0
8863
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9238
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
9157
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
9088
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5995
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
4502
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...
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.