Jump to content

Recommended Posts

Posted

um..... kinda lost now guys ;)

 

Discovered that it is happening on other laptops also.

 

I've tried replacing the xcopy command with a robocopy method too, but the result is the same...

 

instead of copying the start menu from the mapped share at Z:, it copies the My Documents folder [or possibly the networked home dir [H:] that My Documents is redirected too on desktop pc's] into the start menu instead...

 

Not too fussed about the error message - just cant get the thing to work.

 

Any one want to see the crappy script? ;)

 

Nath

Posted

@ECHO OFF

REM ECHO _

ECHO. >> \\\$\test.log
ECHO -START- %DATE% - %TIME% - SYNCING LAPTOP START MENU for %USERNAME% - >> \\\$\test.log

REM ECHO __

ECHO -STAGE1- %DATE% - %TIME% - connection to server - >> \\\$\test.log
net use Z: \\\$\Pre2k\Staff\Laptop /PERSISTENT:NO

REM ECHO ___

ECHO -STAGE2- %DATE% - %TIME% - COPYING START MENU TO LOCAL PROFILE - >> \\\$\test.log
robocopy "Z:\Start Menu" "%USERPROFILE%\Start Menu" *.* /E /Z /NDL /NFL /NJH /LOG+:\\\$\test.log

REM ECHO ____

ECHO -STAGE3- %DATE% - %TIME% - dis-connecting from server - >> \\\$\test.log
net use Z: /DELETE

REM ECHO _____

ECHO -COMPLETE- %DATE% - %TIME% - Process over for %USERNAME% - >> \\\$\test.log

 

no laughing in the back now :p

 

As you can see, its a very simple script and the crazy thing is that even if you have a script of "echo hello world" and nothing else, you still get the CMD error thing.

 

Is there something else that i'm forgetting with this? permissions or something perhaps?

 

As it appears to be doing the same thing [above in the other post] for all the other laptops, i reckon ppl are gonna get narky real quick.

 

I already had the /persistant:no and a /delete after the job is done [not new at batch script writing - tho i dont get too complicated if i can help it hehe].

 

Any thoughts would be very welcome.

 

Nath.

Posted

may be add

 net use >> \\\$\test.log

 

just before stage 2 just so you can can see all the drive mappings.

If you are using XCOPY or ROBOCOPY you may not need the drive mapping at all and just specify the source psth using the original UNC.

 

I think it might also be worth avoid mapping to z: as I think I read in Minasi or somewhere that Windows maps that letter to the share where the logon script is located.

Posted
Nath, try using a different drive letter. I've a funny feeling that MS use the Z: drive during the logon process (think it might be mapped to NETLOGON share on the PDC). I see the initial error relating to UNC paths on CMD based logon scripts as well so it's quite normal. I believe there is a utility somewhere on the net which can silence a CMD script. I'll have a look when I get change.
Posted

ah ha - that could be the answer gents, as I dont think i used the mapped drive until i saw the moaning CMD error and thought it might be that.

 

I'll report back asap...

Posted
we use z: for home drives with no problem although that might be treated differently as its set by the system and not a script.
Posted
I believe there is a utility somewhere on the net which can silence a CMD script. I'll have a look when I get change.

 

Do you have coin operated web access AJ? :)

 

Seriously though, was the utiltily you were thinking of called CMDOW. There's mention of it on the MSFN Unattend install CD site.

Posted
I believe there is a utility somewhere on the net which can silence a CMD script. I'll have a look when I get change.

 

Do you have coin operated web access AJ? :)

 

Seriously though, was the utiltily you were thinking of called CMDOW. There's mention of it on the MSFN Unattend install CD site.

 

Very funny :lol:

 

CMDOW was not what I was thinking of, but it certainly looks like it can do the job. I've seen scripts which call CMDOW on their first line to hide themselves (CMDOW @ /HID), but I did not know it could be used as a launcher as well.

 

edit: I tried it and it appears to work.

 

Syntax: CMDOW /RUN /HID MyScript.CMD

 

another edit: If you want it, get it from www.commandline.co.uk along with lots of other useful looking stuff!

Posted

Managed to get it working....

 

Tried CMDOW but no joy... script didnt seem to run or anything.

 

Just been tweaking things and connecting via X seems to have done the trick - along with a few tweaks to the syntax of the script ;)

 

I can live with the other error hehe ;) The script is normally hidden from view when run anyhow [GP assigned remember].

 

Thanks for the input ppl.

Nath.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...