Hi.
Exe should run only PC.
Exe should not run from either CD or USB port.
Is there a way to check whether it is directory or CD or port?
Can I use File system object to solve this problem?
Regards,
Prakash.s
10 1650
I think the FileSystemObject will tell you a drive type, so you might be able to check that before allowing anything to happen. Specifically, go to your documentation and check out the DriveType property.
I think the FileSystemObject will tell you a drive type, so you might be able to check that before allowing anything to happen. Specifically, go to your documentation and check out the DriveType property.
I did not read the Filesystem Object.....ant thought a diff problem
I think the FileSystemObject will tell you a drive type, so you might be able to check that before allowing anything to happen. Specifically, go to your documentation and check out the DriveType property.
But that wont prevent the EXE to be run. That'll only make it stop before it makes anything.
... but ignore me, im just suscribing here for interest.
But that wont prevent the EXE to be run. That'll only make it stop before it makes anything.
... but ignore me, im just suscribing here for interest.
Hi
I want to stop executing that's all
that means enough to throw message to user so that user can know
app is not running in CD or USB Port.
Regards
Prakash.S
HI
it is very simple
try to create a text file in app.path at the startup (Use file system object to create file). file name should be greater than 8 chars and it must have atleast a space in it.
if app.path refers to a cd drive then it will genrate run time error. trap this error and respond the user accordingly.
if app.path refers a pen drive, there will be no run time error and file system object dont create file on pen drives. now check the existance of the file. if file exists then it is hard drive else it is a flash drive.
regards
manpreet singh dhillon hoshiarpur
... if app.path refers to a cd drive then it will genrate run time error ... file system object dont create file on pen drives ...
Hang on! Surely you can create a file on a CD drive if the CD is rewritable? And are you saying that the FSO cannot create files on a flash drive? That is certainly news to me!
hi
i am very sorry for my last post. i dont know why i wrote that fileSystemObject dont create file on pen drive. it may be in hurry.
i tried creating file on re-writable cd using FSO. but it genrates an error.
sorry once again for the wrong code.
regards
manpreet singh dhillon hoshiarpur
Hi,
Add Reference "Microsoft Scripting RunTime" to your Project and write this code @ runtime in MDIForm_load: -
Dim fso As New FileSystemObject
-
Dim drv As Object
-
Dim fileType As String
-
Set drv = fso.GetDrive(fso.GetDriveName(App.Path))
-
fileType = Choose((drv.DriveType + 1), "Unknown", "Removable", "Fixed", "Network", "CD-ROM", "RAM Disk")
-
MsgBox fileType
-
Set drv = Nothing
-
Set fso = Nothing
-
-
In above code if fileType is not Fixed, then end..
Regards
Veena
Nice piece of work there, Qveen. Although I don't think fileType is a good name for the result, since it's misleading. Perhaps something like fileLocation would be better.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bon Bon |
last post by:
I am trying to run the Java PetStore Demo using clouldscape. But my
default RMI registry port 1099 is taken by some other program. So I am
running cloudscape on port 2001. But then the deployment...
|
by: Andrew Weaver |
last post by:
How do you change the port in which CDONTS will look for Microsoft SMTP
server? I have Imail running on port 25, and I have SMTP service running on
port 26. Any help you can provide me would be...
|
by: VB Programmer |
last post by:
I have both ASP.NET 1.1 and 2.0 on my system. Most of my sites are 1.1.
All of a sudden when I load any solution I get this error:
VS.NET has detected that the specified Web server is not...
|
by: pradeep_TP |
last post by:
hello all,
I want to know how can I check whether a web site us running or not. I have
used HttpWebRequest but when I give a web site address, It takes few number
of seconds to throw exception...
|
by: tommaso.gastaldi |
last post by:
Hi
I am creating a pdf by just printing on Acrobat Distiller. This is
fine.
I need to create a pdf which has a given prespecified name and I do not
wish that
Distiller prompts me for a name....
|
by: TS |
last post by:
i just noticed the website i created in VS 2005 is running on a different
port than the default. I see that it is running on the local web server, and
also that the website i created isn't in IIS....
|
by: comp.lang.php |
last post by:
I came up with functions that I thought would do the trick:
if (!function_exists('smtp_close')) {
/**
* This function will close a socket resource handle
*
* Original function found at...
|
by: David |
last post by:
Is the Development Server part of the .net 2x runtime package or
installed with one installs VS 2005? I wish to run a small web app on
a machine, with the runtime installed, and need to know if I...
|
by: chernevik |
last post by:
Here is a newbie question: how do I get the server examples in the
Preview chapter of "Progamming Python" (Lutz) to run? The code is
supposed to be a little webserver on which to run examples,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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: 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...
|
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...
| |