Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 12th, 2007, 01:02 PM
ceema ceema is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 277 ceema User rank is Corporal (100 - 500 Reputation Level)ceema User rank is Corporal (100 - 500 Reputation Level)ceema User rank is Corporal (100 - 500 Reputation Level)ceema User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 42 m 29 sec
Reputation Power: 8
WSH - & " /SYS OUTPUT=PRINTER" making problem

Hello,

I have written a program to print a schduled task in vb.net. It's working in 3 macvhines, but it's not working in one machind. All the machines are using windows xp. If I will remove the line & " /SYS OUTPUT=PRINTER" , I can see the schdule task as running, but if will include this line in the program, the schdule task is not running even. Please help.

Regards
Ceema


Code:

'1 - base name of the export files 
'RptBase = "qlm" 

'2 - file path of the Qum program used to run the report 
QProgram = "\\dxyp\sun\CO\Programs\COWENQ.EXE" 

'3 - name of the parameter used to create the hard copy and excel outputs 
ParamPreview = "CF08 - DAILY AED" 

'4 - create the windows scripting object, this will be used to run the command lines 
Set WshShell = WScript.CreateObject("WScript.Shell") 

'5 - command line that will be used to create the hard copy 
CmdLine = Chr(34) & QProgram & Chr(34) & " AUTORUN=" & Chr(34) & ParamPreview & Chr(34) & " /SYS OUTPUT=PRINTER" 

'6 - Run the command line, wait until finish to proceed to the next step 
iCmd = WshShell.Run (CmdLine,3,True) 

Reply With Quote
  #2  
Old May 13th, 2007, 08:03 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,635 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1Folding Points: 373781 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 55 m 37 sec
Reputation Power: 1902
--moved to the Scripting Forum this got nothing to do with .NET as far as I can see

Reply With Quote
  #3  
Old May 14th, 2007, 12:46 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Your script is fine. It's very basic and I don't see anything wrong with the syntax. Running WSH scripts as scheduled tasks is sometimes a bit tricky. Try replace the Run method with the Exec method instead.

If that doesn't work, the problem is most likely due to some other system setting.

One useful note to remember when using WSH as a Schedule Task (and this is irrelevant in this case) is to never use environmental variables. They will not run as a scheduled task.
__________________
Click the image if at any point you don't like my decision.

Scripting problems? Windows questions? Ask the Windows Guru!


Reply With Quote
  #4  
Old May 21st, 2007, 03:09 AM
ceema ceema is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 277 ceema User rank is Corporal (100 - 500 Reputation Level)ceema User rank is Corporal (100 - 500 Reputation Level)ceema User rank is Corporal (100 - 500 Reputation Level)ceema User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 5 h 42 m 29 sec
Reputation Power: 8
Acer only it's not working

Hello,
Sorry for being late in checking the thread and giving a reply. Actually, this program is working in all the Compaq PCs but not working in Acer PCs. Do you have any solution.

Regards
Ceema
Quote:
Originally Posted by Nilpo
Your script is fine. It's very basic and I don't see anything wrong with the syntax. Running WSH scripts as scheduled tasks is sometimes a bit tricky. Try replace the Run method with the Exec method instead.

If that doesn't work, the problem is most likely due to some other system setting.

One useful note to remember when using WSH as a Schedule Task (and this is irrelevant in this case) is to never use environmental variables. They will not run as a scheduled task.

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > WSH - & " /SYS OUTPUT=PRINTER" making problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT