Notification

Icon
Error

Copy files from my Lansweeper server to a remote computer's C drive

Posted: Monday, August 8, 2016 6:03:29 PM(UTC)
hasayeret

hasayeret

Member Original PosterPosts: 25
0
Like
Hi guys,

I'm trying to copy files from the local C drive where my lansweeer is sitting to a c drive on a remote computer/
I'm using the following command:

copy /Y c:\or\redemption.dll c:\or\

"or" is the name of the folder where the file is in the server
I'd like it to copy to a folder called "or" in the C drive of whatever computer I'm choosing from the list. The OR folder on the destination computer does not exist so I need Lansweeper to create it for me.

I keep getting "incorrect function" when I run it. I'm using the system account who is also our domain admin

Thoughts?
zberkshier91
#1zberkshier91 Member Posts: 13  
posted: 8/8/2016 8:12:44 PM(UTC)
I ran into a similar need not too long ago trying to push new files from my package share to the client PC.

I ended up finding a VB script that so far has worked really well.

Code:
Dim fso
Const OverwriteExisting = True
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "\\SERVERNAME\defaultpackageshare$\Scripts\Google files\master_preferences", "C:\Program Files (x86)\Google\Chrome\Application\master_preferences", OverwriteExisting
hasayeret
#2hasayeret Member Original PosterPosts: 25  
posted: 8/8/2016 8:20:29 PM(UTC)
Originally Posted by: zberkshier91 Go to Quoted Post
I ran into a similar need not too long ago trying to push new files from my package share to the client PC.

I ended up finding a VB script that so far has worked really well.

Code:
Dim fso
Const OverwriteExisting = True
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "\\SERVERNAME\defaultpackageshare$\Scripts\Google files\master_preferences", "C:\Program Files (x86)\Google\Chrome\Application\master_preferences", OverwriteExisting


Nice!

Can you explain the steps you created the deployment with this script step by step?
Sory but I'm really new to the whole deployment stuff.

Thanks!
zberkshier91
#3zberkshier91 Member Posts: 13  
posted: 8/8/2016 9:04:18 PM(UTC)
Absolutely!

In this example, I'm copying down the master_preferences file for Google Chrome (alternative to GPOs) to the client workstation after the install is finished. Here's what the deployment package overview looks like

Step 1 uninstalls Chrome using the MSI uninstaller type in your package settings. Under the "Version" field, I've left blank to act as a catch all for chrome versions.

Step 2 installs the MSI for 64 bit Google Chrome silently, without rebooting or any GUIs.

Step 3 is basically a fail safe in the event that a reboot occurs after the installation (happened once) it will stop it

Step 4 finished out the package by running the VBscript on the local workstation. Here is how I've structured out the folder so the file get's copied properly

In the script example, change the destination of the file to point to wherever you have it stored on your Lansweeper server, and in the destination, you'll need to include the location. Since it sounds like you need to have that directory created, you may need to tweak with the script to include a command to make a new directory on the client PC.

My thought would probably have that be a step that runs before the script does (most likely by including a command step to make a new directory. Google how to do this via cmd)

Hope all of this helps!
hasayeret
#4hasayeret Member Original PosterPosts: 25  
posted: 8/8/2016 9:11:54 PM(UTC)
Originally Posted by: zberkshier91 Go to Quoted Post
Absolutely!

In this example, I'm copying down the master_preferences file for Google Chrome (alternative to GPOs) to the client workstation after the install is finished. Here's what the deployment package overview looks like

Step 1 uninstalls Chrome using the MSI uninstaller type in your package settings. Under the "Version" field, I've left blank to act as a catch all for chrome versions.

Step 2 installs the MSI for 64 bit Google Chrome silently, without rebooting or any GUIs.

Step 3 is basically a fail safe in the event that a reboot occurs after the installation (happened once) it will stop it

Step 4 finished out the package by running the VBscript on the local workstation. Here is how I've structured out the folder so the file get's copied properly

In the script example, change the destination of the file to point to wherever you have it stored on your Lansweeper server, and in the destination, you'll need to include the location. Since it sounds like you need to have that directory created, you may need to tweak with the script to include a command to make a new directory on the client PC.

My thought would probably have that be a step that runs before the script does (most likely by including a command step to make a new directory. Google how to do this via cmd)

Hope all of this helps!


Thanks so much!
I guess I needed to be more clear: I have 2 DLLs I need to copy from a shared location on a fileserver to each computer's C drive (I'm planning to create a folder in the c drive called "or")
Any chance you can walk me through the copying steps?

Thanks!
zberkshier91
#5zberkshier91 Member Posts: 13  
posted: 8/8/2016 9:28:05 PM(UTC)
Quote:
Thanks so much!
I guess I needed to be more clear: I have 2 DLLs I need to copy from a shared location on a fileserver to each computer's C drive (I'm planning to create a folder in the c drive called "or")
Any chance you can walk me through the copying steps?

Thanks!


Unfortunately, VB scripting isn't my thing either. The information I was able to get was from a really quick google search, but I imagine if you had all of your files included in a folder, you could include a wild card like *.dll which should move anything ending in .dll over.

Sorry I couldn't be much help from there :/
hasayeret
#6hasayeret Member Original PosterPosts: 25  
posted: 8/8/2016 9:33:44 PM(UTC)
Originally Posted by: zberkshier91 Go to Quoted Post
Quote:
Thanks so much!
I guess I needed to be more clear: I have 2 DLLs I need to copy from a shared location on a fileserver to each computer's C drive (I'm planning to create a folder in the c drive called "or")
Any chance you can walk me through the copying steps?

Thanks!


Unfortunately, VB scripting isn't my thing either. The information I was able to get was from a really quick google search, but I imagine if you had all of your files included in a folder, you could include a wild card like *.dll which should move anything ending in .dll over.

Sorry I couldn't be much help from there :/


No problem! really appreciate your help!
Anybody else can help by any chance?
Basically trying to create a deployment package to deploy 1 folder from a shared location on a fileserver to a bunch of computers.

Thanks!
zberkshier91
#7zberkshier91 Member Posts: 13  
posted: 8/8/2016 10:20:37 PM(UTC)
Quote:

No problem! really appreciate your help!
Anybody else can help by any chance?
Basically trying to create a deployment package to deploy 1 folder from a shared location on a fileserver to a bunch of computers.

Thanks!



Checked again at a few guides, in a test script, try changing "FSO.CopyFile" to "FSO.CopyFolder"
GarryP
#8GarryP Member Posts: 1  
posted: 3/1/2017 11:29:48 PM(UTC)
The easiest way I have found to deploy files is by creating a silent self extracting .exe via WinRAR and define paths to extract, overwrite/update, etc. . . . I can create "FolderA" with any arrangement of subfolders and files and create a silent self-extracting .exe and set the absolute path for extraction to (for example) C:\Users\Public\Desktop\ and it works perfect every time. With WinRAR you can define a myriad of setting including "Save file security" "Extract and replace" "Extract and update" "Fresh existing files only".
Bruce.B
#9Bruce.B Member Administration Posts: 562  
posted: 3/3/2017 2:03:35 PM(UTC)
You could use a Robocopy command using the deployment module. Do note that this command seems to return a 1 on success, so do adjust your success codes accordingly.

If the command works locally on a client computer in CMD (referring to your package share though), it should work using the deployment module.
LS_enthusiast_4444
#10LS_enthusiast_4444 Member Posts: 3  
posted: 10/21/2020 9:51:19 PM(UTC)
Originally Posted by: Bruce.B Go to Quoted Post
Do note that this command seems to return a 1 on success, so do adjust your success codes accordingly.


You saved my sanity. From the future, I thank you!

Active Discussions

Lansweeper SSH - Keyboard Interactive Authentication
by  blackmoonwolf   Go to last post Go to first unread
Last post: Today at 5:12:41 AM(UTC)
Lansweeper Get My Documents Folder Size
by  cbraafhart  
Go to last post Go to first unread
Last post: Yesterday at 2:25:18 PM(UTC)
Lansweeper Lansweeper Errors - Licencing and scanning
by  dnkleaf   Go to last post Go to first unread
Last post: 11/27/2020 1:02:13 PM(UTC)
Lansweeper Search for Blank Fields
by  CS Caritas Socialis IT  
Go to last post Go to first unread
Last post: 11/27/2020 12:19:05 PM(UTC)
Lansweeper Uninstalled software still listed
by  Dennis Gewillig   Go to last post Go to first unread
Last post: 11/27/2020 9:19:19 AM(UTC)
Lansweeper Software deployment initiated by user
by  LS_enthusiast_4444   Go to last post Go to first unread
Last post: 11/26/2020 9:28:18 PM(UTC)
Lansweeper Help Desk not disabling for regular users?
by  FrankSc  
Go to last post Go to first unread
Last post: 11/26/2020 8:18:38 PM(UTC)