Question about Operating Systems

2 Answers

USB printing through DOS mode


I am working as a VB6 programmer.

To print a .txt file through DOS mode i am using a batch file with code
copy mydoc.txt to prn:
But it is not working in USB port printers.

Plz send me the VB6 code for printing a text file using USB printers.

Posted by on

  • naga_rajan06 Jul 12, 2008

    Problem: USB printing through DOS mode
    posted by naga_rajan06 on 07/12/2008


    I am working as a VB6 programmer.

    To print a .txt file through DOS mode i am using a batch file with code
    copy mydoc.txt to prn:
    But it is not working in USB port printers.

    Plz send me the VB6 code for printing a text file using USB printers.

  • KrishnaKMR May 11, 2010

    I am working as a VB6 programmer. To print a .txt file through DOS mode i am using a batch file with code copy mydoc.txt to prn: But it is not working in USB port printers. Plz send me the VB6 code for printing a text file using USB printers.

×

2 Answers

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Novelist:

    An expert who has written 50 answers of more than 400 characters.

    Scholar:

    An expert who has written 20 answers of more than 400 characters.

  • Expert
  • 160 Answers

Google for DOS PRINT USB, and you'll find some utilities that do this.

Or, you can include some commands in your batch file.

First, get the device name:

In a DOS window, type NET VIEW ComputerName (or use 127.0.0.1)

Once you know the printer share name, you use it in a batch file.

NET USE lpt1: \\ComputerName\ShareName /Persistent:Y

This captures the print queue to the shared printer.

You must also go into Printer Properties/Advanced/Print Processor and set it to TEXT

Your copy, print and other commands will work.

Posted on Jul 18, 2008

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

Can anyone explain how batch file works?


This is kind of tricky not knowing how familiar you are with the commandline, but a batch file simply contains single commands and executes them in order (usually from top to bottom). A batch file (or bash script in Linux) can be very helpful if you have to run certain commands over and over again, so you don't have to write them by hand.

An Example: You want to store your network settings in a text file.
You open the command prompt (WIN+R) and type this line:
mkdir C:\Network
Then you type this line:
ipconfig /all > C:\Network\ipconfig.txt
The first line creates a folder on your C: drive called "Network"
The second line runs the ipconfig command and saves it as a text file in that new folder.

To make a batch file, you open Notepad and insert the two lines. Then save it as "IP.bat" (make sure not to save it as "IP.bat.txt"! This is the most common mistake. If you save a file from Notepad, select "All Files" in the "Save As Type" dialog. Otherwise it will save it as a .txt file and you have to rename it later.)

Now you can double click the batch file and it runs all commands in the file.

You can also see the danger. If you run a batch file and don't know what it really does, it can destroy your whole system. So make sure you understand it and/or get it from a trustworthy source.

A nice example of how complex a batch file can be is here:
AllHelp.bat

Copy the content into a text file, save it as AllHelp.bat, run it and it will create a webpage with all available DOS commands.

Hope this helps - otherwise let me know if you have specific questions.
Enjoy!

Feb 26, 2012 | HEWLETT-PACKARD Operating Systems

Tip

Cannot Print from Internet Explorer


Issue: Cannot Print from Internet Explorer
Symptoms : When you attempt to print a document or look at it in print preview, you may receive the following error message:
Line: 539
Char: 2
Error: Invalid argument.
Code: 0 URL: res://C:WINDOWSSYSTEMSHDOCLC.DLL/preview.dlg
CAUSE : This issue can occur if the Iepeers.dll file is corrupted or is the incorrect version
Resolution: To resolve this issue, replace the Iepeers.dll file. To do this, follow these steps:

1. Restart the computer in MS-DOS mode or with a startup disk.
a. For Windows 98 and Windows 95 , click Start, click Shut Down, click Restart the computer in MS-DOS mode, and then click Yes.
b. For Windows Millennium Edition (Me), use a Windows Me startup disk and click Start Computer without CD-ROM Support.

For additional information about how to create a Windows Me startup disk, click the article number below to view the article in the Microsoft Knowledge Base:
267287 (http://support.microsoft.com/kb/267287/EN-US/) How to Create a Startup Disk in Windows Me

2. Type the following commands, pressing ENTER after each command:
c:
cdwindowssystem
ren IEPEERS.dll IEPEERS.old
exit

3. Extract a new copy of the Iepeers.dll file to the WindowsSystem folder. You can extract the Iepeers.dll file from the following location:
The IE_5.cab cabinet file included with Internet Explorer 5.5 for Windows 98.

4. Register the Iepeers.dll file. To do this, click Start, point to Run, and then type the following line:
regsvr32 IEPEERS.DLL

5. Click OK.

6. Restart your computer normally.

on May 30, 2008 | Microsoft Windows Vista Home Premium with...

3 Answers

How to create simple batch files


Creating a batch file
MS-DOS users
Microsoft Windows and other users

MS-DOS users
To create a basic batch file in MS-DOS, follow the below steps that give you an example of how to create a basic batch file.

  1. Open an MS-DOS command window or get to MS-DOS. Additional information about doing this can be found on document CHDOS.
  2. At the MS-DOS prompt, type: edit test.bat and press enter.
  3. If typed properly, you should now be in a blue screen. Within the screen, type:

    pause
    dir c:\windows
    dir c:\windows\system

  4. Once the above three lines have been typed in, click File and choose exit; when prompted to save, click "Yes." Users who do not have a mouse cursor can accomplish this same task by pressing ALT+F to access the file menu, then pressing "X" to exit, and pressing enter to save changes.
  5. Once you are back at the MS-DOS prompt, type: test and press enter. This will execute the test.bat file and begin running the file. Because the first line is pause, you will first be prompted to press a key. Once you press a key the batch file will run line-by-line; in this case, listing the files in the windows and windows\system directories.
If you wish to add more lines to this batch file you would simply type "edit test.bat" to edit the file again.
Additional information about the MS-DOS edit command can be found on our edit command page. Some versions of MS-DOS and bootable diskettes may not have the edit command; if this is the case, you would either need to obtain the edit.com file to access this file or use the copy con command.




Microsoft Windows and other users
A Windows user can still use the above MS-DOS steps if they wish to create a batch file. If, however, you're more comfortable using Microsoft Windows or your operating system, you can use any text editor, such as Notepad or Wordpad, to create your batch files, as long as the file extension ends with .bat. In the below example we use the Windows notepad to create a batch file.
  1. Click Start
  2. Click Run
  3. Type: notepad and press enter.
  4. Once notepad is open, type the below lines in the file or copy and paste the below lines into notepad.

    @echo off
    echo Hello this is a test batch file
    pause
    dir c:\windows

  5. Click File and click Save; browse to where you want to save the file. For the file name, type "test.bat", and if your version of Windows has a "Save as type" option, choose "All files", otherwise it will save as a text file. Once all of this has been done click the Save button and exit notepad.
  6. Now, to run the batch file, simply double-click or run the file like any other program. Once the batch file has completed running it will close the window automatically.

Jan 04, 2011 | Operating Systems

1 Answer

HOW CAN I PRINT FOLDER CONTENTS SIMILLAR TO THE DOS CAOMMAND TREE > PRN


Go to start button. In the start menu click RUN and in the box that opens type "cmd"
In the CLI go to the directory of the folder whose content you want to print and type the following and press enter to create list.txt file first before printing.

dir /b /s /on >list.txt

This will give you a text file (list.txt) in the folder, that you
can manipulate, print etc. in a text editor or
word processor. In order to redirect the output
directly to your printer, instead of a text file, type:

dir /b /s /on >prn

Aug 25, 2010 | Microsoft Operating Systems

1 Answer

Dos telnet command with vb 6.0


http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
PLink allows for command link execution passing a username, password and host.
To get the response to a file you could use Shell "C:\windows\cmd.exe /c batch.bat > C:\file.txt"
Batch.bat contains your plink script and file.txt is the output.

Feb 03, 2009 | Microsoft Windows XP Professional With...

1 Answer

How to use cmd ?


to use the command prompt, press the "start" and "R" keys on the keyboard.
On the small, "Run" screen, type cmd.
click ok.

type help in the command prompt. This should print a list of commands that you can use with it.
This is what it puts on-screen:
For more information on a specific command, type HELP command-name
ASSOC Displays or modifies file extension associations.
AT Schedules commands and programs to run on a computer.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
CHDIR Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHKNTFS Displays or modifies the checking of disk at boot time.
CLS Clears the screen.
CMD Starts a new instance of the Windows command interpreter.
COLOR Sets the default console foreground and background colors.
COMP Compares the contents of two files or sets of files.
COMPACT Displays or alters the compression of files on NTFS partitions.
CONVERT Converts FAT volumes to NTFS. You cannot convert the
current drive.
COPY Copies one or more files to another location.
DATE Displays or sets the date.
DEL Deletes one or more files.
DIR Displays a list of files and subdirectories in a directory.
DISKCOMP Compares the contents of two floppy disks.
DISKCOPY Copies the contents of one floppy disk to another.
DOSKEY Edits command lines, recalls Windows commands, and creates macros.
ECHO Displays messages, or turns command echoing on or off.
ENDLOCAL Ends localization of environment changes in a batch file.
ERASE Deletes one or more files.
EXIT Quits the CMD.EXE program (command interpreter).
FC Compares two files or sets of files, and displays the differences
between them.
FIND Searches for a text string in a file or files.
FINDSTR Searches for strings in files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with Windows.
FTYPE Displays or modifies file types used in file extension associations.
GOTO Directs the Windows command interpreter to a labeled line in a
batch program.
GRAFTABL Enables Windows to display an extended character set in graphics
mode.
HELP Provides Help information for Windows commands.
IF Performs conditional processing in batch programs.
LABEL Creates, changes, or deletes the volume label of a disk.
MD Creates a directory.
MKDIR Creates a directory.
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files from one directory to another directory.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POPD Restores the previous value of the current directory saved by PUSHD.
PRINT Prints a text file.
PROMPT Changes the Windows command prompt.
PUSHD Saves the current directory then changes it.
RD Removes a directory.
RECOVER Recovers readable information from a bad or defective disk.
REM Records comments (remarks) in batch files or CONFIG.SYS.
REN Renames a file or files.
RENAME Renames a file or files.
REPLACE Replaces files.
RMDIR Removes a directory.
SET Displays, sets, or removes Windows environment variables.
SETLOCAL Begins localization of environment changes in a batch file.
SHIFT Shifts the position of replaceable parameters in batch files.
SORT Sorts input.
START Starts a separate window to run a specified program or command.
SUBST Associates a path with a drive letter.
TIME Displays or sets the system time.
TITLE Sets the window title for a CMD.EXE session.
TREE Graphically displays the directory structure of a drive or path.
TYPE Displays the contents of a text file.
VER Displays the Windows version.
VERIFY Tells Windows whether to verify that your files are written
correctly to a disk.
VOL Displays a disk volume label and serial number.
XCOPY Copies files and directory trees.

this window is used only when the desktop cannot be accessed.
For a user-friendly interface (easier to use), use My computer to do common tasks.

Aug 25, 2008 | Microsoft Windows Vista Home Premium with...

1 Answer

NET WORK DOS PRINT


1.
copy [disk][path][filename] print

2.
print [disk][path][filename]

Example:
copy c:\log.txt print
print c:\log.txt

Jan 12, 2008 | Microsoft Windows XP Professional With...

1 Answer

Running a dos batch file in background in windows


Batch file for what?

I once ran across a software called Dosbox that I used to run a customers dos based notes program in XP. It worked well, not sure about batch files, but worth a shot I suppose.

You can find info on it here - http://dosbox.sourceforge.net/

 

Oct 17, 2007 | Microsoft Windows XP Professional for PC

2 Answers

How to edit registry


1) to edit registry go to start / select run and type regedit. from there you are able to edit registry values. BEWARE because editing registry values may make your windows stop working. you should know what you are doing and you are responsible of the cosnequenses 2) a bat file is a batch file. Batch files are files that allow MS-DOS and Microsoft Windows users to create a lists of commands and/or programs to run once the batch file has been executed. 3) create a file called autorun.inf and type inside [autorun] open=file.exe save your file and write it in the cd you want to autorun the file.exe part must be replaced with the executable you want to load when your CD autoruns

Oct 08, 2007 | Microsoft Windows XP Professional With...

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

1,472 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18299 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...