Jump to content

Recommended Posts

Posted

Trying to install new version of Wordshark. It currently just runs from the server, but im all for giving the pc's the workload. According to the intructions i need to deploy two folders to the client whilst the shared data stays on the server.

 

How and also where is the best place to put these on the client?

Posted

simplest if its more that 2 or 3 files then easiest way is a startup script

 

copy folders\files to \\server\share\wordshark\ (replace with your real location)

 

if exist "c:\program files\wordshark\folder1" goto end

xcopy "\\server\share\wordshark\" c:\program files\wordshark\" /c/e/h/y/s

 

:end

  • Thanks 1
Posted

Ok, can i do the if exist twice?

 

'\\Curricsvr1\netlogon\Tools'

CMD.EXE was started with the above path as the current directory.

UNC paths are not supported. Defaulting to Windows directory.

 

C:\Windows>if exist "c:\program files\wordshark\wordshark-public" goto end

 

C:\Windows>if exist "c:\program files\wordshark\wordshark-programs" goto end

 

C:\Windows>xcopy "\\curricsvr1\apps\wordshark 4.8\" c:\program files\wordshark\" /c/e/h/y/s

Parse Error

 

This is me just testing to see if it works..

 

Not quite sure what its issue is with the UNC path? Go on, what daft mistake have i made?

Posted
Ok, can i do the if exist twice?

 

 

 

This is me just testing to see if it works..

 

Not quite sure what its issue is with the UNC path? Go on, what daft mistake have i made?

 

youre missing a "

 

xcopy "\\curricsvr1\apps\wordshark 4.8\" c:\program files\wordshark\" /c/e/h/y/s

 

should be

 

xcopy "\\curricsvr1\apps\wordshark 4.8\" "c:\program files\wordshark\" /c/e/h/y/s

Posted
Got it right 4th time! lolz

 

Now to get it to run on startup....

 

and thats why i gave up programming spend ages doing some code only to be foiled by a single letter which takes longer to find than it did to write the code lol

Posted
Alternatibe to scripting could you have done this through GPP under the computer startup>Windows Settings> Files/Folders. Use Item level targetting to check if the folder exists should do the same thing without having to check syntax.
Posted
Alternatibe to scripting could you have done this through GPP under the computer startup>Windows Settings> Files/Folders. Use Item level targetting to check if the folder exists should do the same thing without having to check syntax.

 

true but you have to specify each individual item in a folder so say a folder has 50 files in it its a pain via gpp

Posted
true but you have to specify each individual item in a folder so say a folder has 50 files in it its a pain via gpp

Not true, use the Files Extension to copy the files in one go:

Group Policy includes the Files preference extension. For computers or users, this extension allows you to:

  • Copy a file (or multiple files in one folder) to a new location and then configure the attributes of those files. New subfolders are created as necessary.

Posted
Not true, use the Files Extension to copy the files in one go:

 

where im on an 08r2 box and cant see any way of doing multi files

Posted
where im on an 08r2 box and cant see any way of doing multi files

Looking at r2 here as well, directly above the 'Folders' option in GPPs is 'Files' - you specify a source and destination and it copies.

Posted
Looking at r2 here as well, directly above the 'Folders' option in GPPs is 'Files' - you specify a source and destination and it copies.

 

if i select a folder it just opens it thats how ive been doing odd files like ini files

 

gppfile.jpg

Posted

But have you ever tried using wildcards in the source path?

From the GPP help:






Source file(s) Type the location from which to copy the Source file(s). This location can be a fully qualified UNC path or a path on a local or mapped drive from the perspective of the client. This field can contain variables.
This field can also contain single character (?) and multiple character (*) wildcards, allowing you to copy or modify multiple files.
This option is available only if the action selected is Create, Replace, or Update.

Posted
But have you ever tried using wildcards in the source path?

From the GPP help:

 

honesly no as its gui based i assumed it would let me shift/control/folder select if it allowed it hmm i will have to have a look at that one day.

 

so instead of having \\server\share\folder\file1.txt i could paste \\server\share\folder\*.txt there etc?

Posted

Only just noticed this, but if you put a * in the path the 'Destination file' box is relabelled to 'Destination folder' (not completely intuitive!)

So yeah you put source = "\\some_server_share\files\*" and destination = "c:\files_here_please" and all the files would be copied from the server share to the local machine.

  • Thanks 1
Posted

its letting me do it but files arnt being copied (granted its a slightly lazy copy from netlogon to test) and the folder exists i gppd that as well that worked fine

gppfile2.jpg

Posted
its letting me do it but files arnt being copied (granted its a slightly lazy copy from netlogon to test) and the folder exists i gppd that as well that worked fine

[ATTACH=CONFIG]15315[/ATTACH]

 

I've done it without the *.* in the destination...so you would have C:\Test01\. Not sure if that makes a difference or not to be honest.

  • Thanks 1
Posted (edited)
I've done it without the *.* in the destination...so you would have C:\Test01\. Not sure if that makes a difference or not to be honest.

 

yup sigh :doh:

dosent seem to do subfolders though (though that may just be a case of waiting i suppose after gpupdate /force)

 

typical i log off give it one last check and my extra folder copied across :doh:

Edited by sted
Posted

If im scripting a file / folder copy in the script I usually add a drive mount, and then once the copy is finished do a "net use * /del /yes" or only dismount the drive im copying from.

 

I hope you get what I mean, It seems to be the quickest way I've found of doing things like this. I have a logon tracker that does just this except it writes to a log file rather than copy a file.

 

So when a user logs in the drive is mounted then the logon details of that user using variables like time, date. machine name, user name etc are all added to the log file and its all done that quick the users never see the mapped drive, and if they try to access it they cant anyway.

 

Hope this helps.

Posted

Ok, heres a question. Say the script is running in the background, is halfway through and then suddenly...i dunno, the battery goes on the netbook, or a kid turns the machine off.

 

Does it compare the folders when checking ifexist? Im just thinking, if the folder is there but half the files are missing what does it do?

Posted
Ok, heres a question. Say the script is running in the background, is halfway through and then suddenly...i dunno, the battery goes on the netbook, or a kid turns the machine off.

 

Does it compare the folders when checking ifexist? Im just thinking, if the folder is there but half the files are missing what does it do?

 

depends if the file you check for is copied first or last

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...