Computing.Net > Forums > Disk Operating System > psexec error when launching .cmd

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

psexec error when launching .cmd

Reply to Message Icon

Name: paultown
Date: November 7, 2004 at 16:50:16 Pacific
OS: WIN NT4
CPU/Ram: Pentium 4 1.2Ghz 512MG RA
Comment:

I have created the following batch file that automatically creates a file call printer.vbs on a remote system, but when I try to get psexec to lauch the file I get an error "The system cannot find the file specified."
The file is defidently there and can't understand why it can't be launched.
I tried a variation by getting the batch file to create another batch file that calls for printer.vbs but got the same error.
The code is as follows:-

@echo off
cls
echo Add Printer %2 on %1
echo ____________________________________________
echo.

if {%1}=={} goto HowTo
if {%2}=={} goto HowTo

CALL
>>\\%1\c$\apps\nai\printer.vbs E-------------------
>>\\%1\c$\apps\nai\printer.vbs ECHO ' Printer Install for network printer:
>>\\%1\c$\apps\nai\printer.vbs ECHO ' %2
>>\\%1\c$\apps\nai\printer.vbs E-------------------
>>\\%1\c$\apps\nai\printer.vbs ECHO Dim net
>>\\%1\c$\apps\nai\printer.vbs ECHO Set net = CreateObject("WScript.Network")
>>\\%1\c$\apps\nai\printer.vbs ECHO net.AddWindowsPrinterConnection "%2"
>>\\%1\c$\apps\nai\printer.vbs E-------------------

Call Wait 10
psexec \\%1 -c c:\apps\nai\printer.vbs


echo Printer %2 has been successfully added on %1.

Goto End

:HowTo
echo Adds a printer on the target workstation
echo.
echo Usage: Printer [Computername] [\\Server\Printer]
echo.

:End
pause


I added the call wait 10 line just to make sure the file did get created before psexec tried to launch it, but still failed.
I get the following error in the command prompt:-

[b]PsExec v1.42 - execute processes remotely
Copyright (C) 2001-2003 Mark Russinovich
www.sysinternals.com


Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

C:\WINNT\system32\printer.vbs(8, 1) (null): The system cannot find the file spec
ified.

cscript.exe exited on wau34420180 with error code 0.[/b]

Any ideas?
Anyone have any thoughts as to why psexec can't find the file?
Thanks in advance

Paul...



Sponsored Link
Ads by Google

Response Number 1
Name: paultown
Date: November 7, 2004 at 16:52:54 Pacific
Reply:

Sorry psexec line reads:-
[b]psexec \\%1 cscript.exe printer.vbs[/b]

Paul...


0

Response Number 2
Name: jboy
Date: November 7, 2004 at 17:54:28 Pacific
Reply:

NT or programming forums would be more appropriate places for troubleshooting complex batch files running on a DOS emulation in a WinNT environment.


98% of all statistics are made up


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: psexec error when launching .cmd

error when booting up from a bootable cd www.computing.net/answers/dos/error-when-booting-up-from-a-bootable-cd/11186.html

Checksum error when booting www.computing.net/answers/dos/checksum-error-when-booting/416.html

Error when booting up. www.computing.net/answers/dos/error-when-booting-up/12813.html