Jump to content

Recommended Posts

Posted

Hi I am trying to run this script at startup via GPO

 

I can get it to run the second xcopy line and can get the if exists to work.

 

But when I add the xcopy for the desktop shortcut it will run if I manually test the script but not the GPO Startup

 

 

@echo off

Copy Minetest folder to C from FS01

 

if exist "%userprofile%\Desktop\Minetest.lnk" goto end

 

xcopy "\\fs01\SoftwareDrivers\Software\Minetest Script\Minetest.lnk" "%userprofile%\Desktop" /s /i

xcopy "\\fs01\SoftwareDrivers\Software\Minetest" "c:\Minetest" /s /i

 

exit

Posted (edited)

Among other errors, you are saying goto end but you don't have an end label so it will error out if the file exists and you're not checking the other folder exists.

 

@ECHO OFF
::Copy Minetest folder to C from FS01

IF EXIST "%userprofile%\Desktop\Minetest.lnk" GOTO SKIP1

xcopy "\\fs01\SoftwareDrivers\Software\Minetest Script\Minetest.lnk" "%userprofile%\Desktop" /s /i

:SKIP1

IF EXIST "c:\Minetest" GOTO SKIP2

xcopy "\\fs01\SoftwareDrivers\Software\Minetest" "c:\Minetest" /s /i

:SKIP2

 

You can use a GPO to place this file though, it will be a lot cleaner.

Edited by ChrisMiles
  • Thanks 2
Posted (edited)
I have tried the amended script and it will only work manually.

Also tried GPO to copy the desktop shortcut and this failed.

 

Your script looks to be copying the icon to the user profile desktop. You may need to use %public%\desktop or c:\users\public\desktop if you want it on all users desktop.

If you are wanting the icon on the user profile desktop then you need to run as a login script rather than startup script, or use group policy preferences.

Edited by clydey10
  • Thanks 1

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