473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

The process cannot access the file 'D:\pagefile.sys'

I m Using the Foll. method to Read the Contents of a File. If i m reading the doc,txt prog is working file. I m using the File "D:\pagefile.sys", ERROR is there,The process cannot access the file 'D:\pagefile.sys' because it is being used by another process.
how To Read Contents of "D:\pagefile.sys".
Need UR Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand|Select|Wrap|Line Numbers
  1.  
  2. Imports System.io
  3. Module Module1
  4.  
  5. Sub Main()
  6. Dim fs As FileStream
  7. fs = New FileStream("D:\Documents and Settings\Administrator\Desktop\SCAN%20HDDDDDDDDDDDDDDDD[1].doc", FileMode.Open, FileAccess.ReadWrite, FileShare.Read)
  8. Dim d As New StreamReader(fs)
  9.  
  10. d.BaseStream.Seek(0, SeekOrigin.Begin)
  11.  
  12. While d.Peek() > -1
  13. Console.WriteLine(d.ReadToEnd)
  14. Console.ReadLine()
  15. End While
  16. d.Close()
  17.  
  18.  
  19. End Sub
  20.  
  21. End Module
  22.  
Jun 17 '08 #1
3 3852
Curtis Rutland
3,256 Expert 2GB
Well, for one thing you shouldn't try to use ReadWrite access to it.
Jun 17 '08 #2
Plater
7,872 Expert 4TB
PageFile.sys is a system file. It is IN USE and i believe it will lock it against writing AND reading.

I see no pivital reason for you to need access to the file?
Jun 17 '08 #3
Curtis Rutland
3,256 Expert 2GB
PageFile.sys is a system file. It is IN USE and i believe it will lock it against writing AND reading.

I see no pivital reason for you to need access to the file?
Yeah, that's what I thought too. I didn't want to say it without trying, and I didn't want to try right now.

But I'm pretty sure that you can't get into one of the locked system files while the OS is running, except maybe in safe mode. And even in safe mode, you shouldn't be able to get into the pagefile.
Jun 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ron | last post by:
I've written a screen saver which opens multiple copies on windows 98. I'm trying to check the process list to determine if it is already running. So far all the example win32 routines I've...
9
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit...
0
by: Zed | last post by:
I have a problem with .net writing to a remote server that I need to deploy on. The app works fine on my local machine. But when got access to the server I went to VS.NET and tried to create a...
2
by: Cédric Rossé | last post by:
Hello, I'm currently developping a web application and I'm trying to execute a batch file (.cmd) on the server side when the client presses a button on a web page. When I do this on my local...
43
by: ZillionDollarSadist | last post by:
Hello, I'm working at a simple Access '97 + VB4 application, and I ran into a terrible problem: something I never modified now gives me a totally unwanted "Invalid use of null" error. It happens...
10
by: I. Myself | last post by:
Suppose we spawn a child process with Popen. I'm thinking of an executable file, like a compiled C program. Suppose it is supposed to run for one minute, but it just keeps going and going. Does...
8
by: cypher543 | last post by:
This has been driving me insane for the last hour or so. I have search everywhere, and nothing works. I am trying to use the subprocess module to run a program and get its output line by line. But,...
1
by: Adam Atlas | last post by:
What is the best way for a Python process (presumed to be a script run by the interpreter binary, not embedded in some other program) to restart itself? This is what I've been trying: import...
1
by: tanya.wang | last post by:
I want to access files from a remote server so I mapped it in my server under z:\ for \\myserver\web\mysite\images\ I added this UNC path to my IIS virtual directory and name it as "upload" but I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.