Re: csccmd not running in script
- From: Tom Lavedas <tglbatch@xxxxxxx>
- Date: Thu, 18 Dec 2008 11:23:32 -0800 (PST)
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/
.
- Follow-Ups:
- Re: csccmd not running in script
- From: wcmulligan
- Re: csccmd not running in script
- References:
- csccmd not running in script
- From: wcmulligan
- Re: csccmd not running in script
- From: Richard Mueller [MVP]
- Re: csccmd not running in script
- From: wcmulligan
- Re: csccmd not running in script
- From: Richard Mueller [MVP]
- Re: csccmd not running in script
- From: wcmulligan
- csccmd not running in script
- Prev by Date: Re: Significant improvement of BennySort. (code: 106 lines)
- Next by Date: Re: Sorting in vbscript.
- Previous by thread: Re: csccmd not running in script
- Next by thread: Re: csccmd not running in script
- Index(es):
Relevant Pages
|