|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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)
|
|
#2
|
||||
|
||||
|
--moved to the Scripting Forum this got nothing to do with .NET as far as I can see
|
|
#3
|
||||
|
||||
|
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! |
|
#4
|
|||
|
|||
|
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:
|
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > WSH - & " /SYS OUTPUT=PRINTER" making problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|