Problem with a script that should remove and add shortcuts

Greatness

New member
Local time
1:26 AM
Messages
17
Hi.

Im going to install windows 7 on 20+ machines. So I have taken an old auto-install script I had for windows XP and trying to make it work for windows 7.

WHat I want it to do is to remove the shortcut "spark.exe.ink" for all users from the desktop and I want "spark.exe.ink" to be added to the "autostart" for all users

So here is the string from the old script:

echo.
echo Städa Spark...
xcopy "%ALLUSERSPROFILE%\desktop\Spark.exe.lnk" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup\spark.exe.lnk" /I /E /H /Q

del "%ALLUSERSPROFILE%\desktop\Spark.exe.lnk"


How do I make it work in windows 7?
Is the enviorment variable %allusersprofile% not working in windows 7?

Thanks for any help

Regards
Greatness
 
Last edited:

My Computer

OS
Windows 2008 R2, Windows 7 Enterprise, Ubuntu 11.10
CPU
Intel i5-2500k
Motherboard
Asus
Memory
16gb DDR3 vengance
Graphics Card(s)
Ati Radeaon 6800 HD
Monitor(s) Displays
2 * 24"
Hard Drives
2 * SSD 120gb Force series.
3 * 1 TB
2 * 1,5TB
What happens when you try to run it?

%ALLUSERSPROFILE% is valid in Win 7, points to C:\Programdata

%ALLUSERSPROFILE%\desktop\Spark.exe.lnk" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup is also valid, so it the copy and delete should work.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
What happens when you try to run it?

%ALLUSERSPROFILE% is valid in Win 7, points to C:\Programdata

%ALLUSERSPROFILE%\desktop\Spark.exe.lnk" "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup is also valid, so it the copy and delete should work.

When I run it it says "spark.exe.lnk cant be found" on all three operations.
But %ALLUSERSPROFILE%\desktop\Spark.exe.lnk -> c:\programdata\desktop\spark.exe.lnk .. But there is no user data in "programdata" is there?
I might be completly wrong.
But when I run it, it dosent find the file, so it cant copy it or remove it.

Regards
Greatness
 

My Computer

OS
Windows 2008 R2, Windows 7 Enterprise, Ubuntu 11.10
CPU
Intel i5-2500k
Motherboard
Asus
Memory
16gb DDR3 vengance
Graphics Card(s)
Ati Radeaon 6800 HD
Monitor(s) Displays
2 * 24"
Hard Drives
2 * SSD 120gb Force series.
3 * 1 TB
2 * 1,5TB
There is no desktop folder under %ALLUSERSPROFILE% (C:\Programdata).

Maybe what you are looking for is: C:\Users\Default\Desktop ????

Maybe that's where the spark.exe.lnk file is located?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Back
Top