windows - Copy-Item shortcut fails to copy -


i have list of files need put on every new computer company gets , have automated powershell, can't last part work. command not working i'm wanting put shortcut in start_menu. have found out in order myself put file in location requests administrator permission copy. account admin click continue , file transfer. want automated.

copy-item g:\work\bginfo\updatebginfo.lnk c:\programdata\microsoft\windows\start_menu -force 

also when test file location comes false if have manually put shortcut @ location.

test-path c:\programdata\microsoft\windows\start_menu\updatebginfo.lnk 

so after looking more of developer code microsoft found answer. according found add "" when code in powershell needs have space.

original code: copy-item g:\work\bginfo\updatebginfo.lnk c:\programdata\microsoft\windows\start_menu -force

correct code: copy-item "g:\work\bginfo\updatebginfo.lnk c:\programdata\microsoft\windows\start menu" -force


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -