Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Open File In Notepad
Message
From
08/02/2013 14:07:40
 
 
To
08/02/2013 11:25:30
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01565495
Message ID:
01565518
Views:
45
Notepad does accept a filename as a command-line parameter. It assumes at most one filename. If you try to use multiple filenames on command line such as:
NOTEPAD file1 file2 file3
will result in notepad trying to open a file called "file1 file2 file3 (and if you try using commas as parameter separator, the commas are part of the filename it tries opening). If you use quotes around the filenames such as:
NOTEPAD "file1" "file2" "file3"
results in only file1 being opened. This means if you want ot open more than one file in notepad, you need to launch notepad separately for each file.

Although this would mean that you probably don't need to put quotes around filename if you've got embedded spaces within the filename or path to filename, I'd recommend putting quotes around the filename anyway -- just in case there is a version of notepad that behaves differently, or if someone replaces notepad with a different program (I'd seen this done on more than occasion).

>ShellExecute uses the program that is setup for a particular file type. You may try using the RUN /N command, but I don't know if you can pass the file name as a parameter to Notepad.
>
>>I am Using the follwing function to Open File through Program
>>
>>declare long ShellExecute in "shell32.dll" ; && Function to Open a File
>> long hwnd, ;
>> string lpszOp, ;
>> string lpszFile, ;
>> string lpszParams, ;
>> string lpszDir, ;
>> long nShowCmd
>>
>>lnResult = SHELLEXECUTE(0, 'open', 'master.ps', '', '', 1)
>>
>>The file is well opened in PS Viewer. However For my Program Use I want that when The User clicks, It should open in Notepad. (As I want User to Read/Write Data Inside through Notepad)
>>
>>So How to force a File to Open in Notepad ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform