-
February 4th, 2014, 06:30 PM
#1
[RESOLVED] how to combine 2 "batch" commands in xp virtual mode
hi all.
last fall i installed windows 7 with xp running in virtual mode (see here http://discussions.virtualdr.com/sho...-xp-mode).most of the reason for this
was to be able to run some legacy basic programs (qbasic does not run in 7 but still does in xp) and print to a laser printer.
this is the batch command i use to run one of these programs:
QB /RUN C:\DATA\NCR\RECONCIL.BAS
this is the property window of the desktop shortcut to that command:
batchcommand_zps513a4d9e.jpg
the programs run fine. calculates fine. prints fine. everythig is fine. except that once per week or so nothing prints. what i need to do when that happens is to run the following command which i have set up as another desktop batch shortcut:
net use lpt1: \\virtual_xp\p2035 /persistent:yes
when i re-run the basic program, everything prints fine again. what i'd like to do is somehow combine these two so that i (or more importantly someone else when i'm not here) would be able to launch a single desktop shorcut that will execute the "net use" command and then launch the qbasic command.
any thoughts?
thanks in advance.
-
February 4th, 2014, 06:41 PM
#2
Can't you just add the net use command to the RECONCIL.bat?
-
February 5th, 2014, 11:02 AM
#3
i've tried that but i get the following error after the "net use" line:
system error 85 has occurred.
The local device name is already in use.
i don't know what that means
-
February 5th, 2014, 12:02 PM
#4
I would guess that it means the LPT1 is already in use.
You could maybe add a line in the bat file to kill the use,,,,and then add it back in.
-
February 5th, 2014, 12:18 PM
#5
You might try redirecting the output of the net use command to NUL:
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul
qb /run c:\data\ncr\reconcil.bas
If you want everything all on one line, try inserting an ampersand ("&") between the two commands:
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul & qb /run c:\data\ncr\reconcil.bas
Or maybe, like Steve suggested:
net use /delete lpt1:
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul
qb /run c:\data\ncr\reconcil.bas
Last edited by SpywareDr; February 5th, 2014 at 12:21 PM.
-
February 5th, 2014, 01:25 PM
#6
i used the following as the batch file:
net use /delete lpt1:
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul
qb /run c:\data\ncr\reconcil.bas
it works. rather, it doesn't not work. i guess i'll only be able to tell if it works if i don't have to reset the printer manually. a week or so will tell me. i'll let you all know.
thanks again, midknyte, steve and doc
-
February 5th, 2014, 01:42 PM
#7
You're welcome zeszut.
If it stops again, you might also try these two commands:
net stop spooler
net start spooler
-
February 5th, 2014, 02:15 PM
#8
-
February 5th, 2014, 03:20 PM
#9
No problem.
-
February 6th, 2014, 01:07 PM
#10
first new day startup & small glitch.
last night i hibernated the virtual xp and then shut down the 7. this morning, i booted up 7 and then xp. launched the desktop icon and got this:
net use /delete lpt1:
lpt1 was deleted successfully.
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul
System error 66 has occurred.
then the reconcil.bas launched but nothing printed. when i launched the desktop icon a second time, everything was fine.
i went back and tried something different. i shutdown the virtual xp (instead of hibernate) then relaunched xpvm. this time i got this:
net use /delete lpt1:
The network connection could not be found.
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul
System error 66 has occurred.
then the reconcil.bas launched but nothing printed. again, when i launched the desktop icon a second time, everything was fine.
any thoughts?
i could do either at the end of the day - shutdown or hibernate the xp - but i prefer to hibernate it. it's faster and i found that if i shutdown the xp the icons are scrambled when i launch it again.
-
February 6th, 2014, 01:39 PM
#11
Originally Posted by zeszut
first new day startup & small glitch.
last night i hibernated the virtual xp and then shut down the 7. this morning, i booted up 7 and then xp. launched the desktop icon and got this:
net use /delete lpt1:
lpt1 was deleted successfully.
So we know it does work.
Originally Posted by zeszut
net use lpt1: \\virtual_xp\p2035 /persistent:yes>nul
System error 66 has occurred.
Does this work maybe?
net use lpt1: \\127.0.0.1\p2035 /persistent:yes
Originally Posted by zeszut
i went back and tried something different. i shutdown the virtual xp (instead of hibernate) then relaunched xpvm. this time i got this:
net use /delete lpt1:
The network connection could not be found.
If the connection to LPT1 is not currently active, then yes, you would get that message.
Originally Posted by zeszut
then the reconcil.bas launched but nothing printed. again, when i launched the desktop icon a second time, everything was fine.
any thoughts?
After reconcil.bas has launched and nothing will print, does stopping and restarting the spooler get it going?
net stop spooler
net start spooler
Originally Posted by zeszut
i could do either at the end of the day - shutdown or hibernate the xp - but i prefer to hibernate it. it's faster and i found that if i shutdown the xp the icons are scrambled when i launch it again.
Know what you mean; hate when that happens. Save and Restore Desktop Icon Layout in Windows Vista and XP.
-
February 6th, 2014, 02:11 PM
#12
thanks, doc. "net use lpt1: \\127.0.0.1\p2035 /persistent:yes" works perfectly. both after shutdown and hibernate.
and a BIG thanks for the tip on saving and restoring the icon layout in xp!
-
February 6th, 2014, 02:25 PM
#13
Excellent, and you're more than welcome!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|