Re: csccmd not running in script

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Dec 18, 1:33 pm, wcmulligan <wcmulli...@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
Thanks again Richard, but I don't get a return value.

I moved the code around a little so that csccmd runs before anything else
and I get no echo.  I do get an echo in other parts of the script, so I don't
know why it is not working.

I am running the command with full admin priveledges on an xp box for
testing. this util won't work with Vista.

FYI here is a link to Microsoft's csccmd.exe syntaxhttp://support.microsoft.com/default.aspx/kb/884739

"Richard Mueller [MVP]" wrote:
I'm not familiar with the csccmd utility, but the %username% environment
variable resolves correctly when I run commands with the Run method. I would
use:

strCmd = "%comspec% /c csccmd /moveshare:\\OldShare\%username%$
\\DFS\user\shares\%username%"
Set objShell = CreateObject("Wscript.Shell")
intReturn = objShell.Run(strCmd, 2, True)
Wscript.Echo "Return code: " & CStr(intReturn)

The parameter "2" means to run minimized. The "True" means to wait for the
command to complete so we can retrieve the return code. This way we can echo
the return code. If it is non-zero, the csccmd returned an error code that
may help troubleshoot.

One possibility is that there is a permission issue. If the OS is Vista, for
example, you may need to use "Run as Administrator" when you run the script.
Being logged in as Administrator means nothing in Vista. Also, is csccmd on
the path? If not, you should include the path in the command.

--
Richard Mueller
MVP Directory Services
Hilltop Lab -http://www.rlmueller.net
--

"wcmulligan" <wcmulli...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:244C53E3-8A62-420B-9405-02E407BA57B0@xxxxxxxxxxxxxxxx
Thank you Richard, but this didn't do the trick either.

I can run csccmd /moveshare:\\OldShare\%sername%$
\\DFS\user\shares\%username%  from the command line or a batch file, but I
can't get it to run in a script.

I've checked and it runs up to the point of the command and then stops.

Anyone have any ideas that might help?

"Richard Mueller [MVP]" wrote:

"wcmulligan" <wcmulli...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CEDB4345-D420-4F3D-BDD5-64716B7C5651@xxxxxxxxxxxxxxxx
Hello,

I am editing a script to move users to a new file share.  The changes
to
the
new server work fine, but the last part of the script to change the
offline
files server never seems to run.

WshShell.Run "c:\csccmd.exe /moveshare:\\OldShare\%username%$
\\DFS\user\shares\%username%"

Never seems to run.  Is there something wrong with this line or is
their
something I am missing.

I'm on a deadline any help is appreciated.

I always prefix commands with "%comspec% /c" when I use the Run method of
the wshShell object.

--
Richard Mueller
MVP Directory Services
Hilltop Lab -http://www.rlmueller.net
--

Does the username have a space in it? Are you running this as a
logged in user? Is the error trapping disabled in the script
disabled? If so, re-enable it (remove ON ERROR RESUME NEXT line) and
report what the real error is. I say that because you say you get no
output, when you really should.

Finally, can you show us the EXACT (cut and paste) code for the
objShell.Run line (with Richard's proposed fix - which is correct)?
Someone might see something you've missed.

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
.



Relevant Pages

  • Re: csccmd not running in script
    ... I moved the code around a little so that csccmd runs before anything else ... I do get an echo in other parts of the script, ... command to complete so we can retrieve the return code. ...
    (microsoft.public.scripting.vbscript)
  • Re: Why no output display when I input at console
    ... echo running $e: ... There is no output on screen, which is not like that in script file ... After you think you fixed your PATH variable, look at it with the command ...
    (comp.unix.shell)
  • Re: Referencing Korn Shell Array Names as a Variable
    ... Your idea worked for displaying the output from the command. ... $ echo $ ... # Attempt to use variable array name and index to reference array value ... The issue is with this line of the script ...
    (comp.unix.shell)
  • Re: csccmd not running in script
    ... Thanks again Richard, but I don't get a return value. ... I moved the code around a little so that csccmd runs before anything else ... command to complete so we can retrieve the return code. ... you may need to use "Run as Administrator" when you run the script. ...
    (microsoft.public.scripting.vbscript)
  • Re: redirect for stdout in ${command_line}
    ... echo "Command line is shown below:" ... # END OF SCRIPT# ... I would accept a variable and build a command line while ... echo "Temp file contents are shown below:" ...
    (comp.unix.aix)