I have a server thats does automatic backups, now i need to sync that backup files to google drive, but i dont want to login every day into windows server so google drive make the sync.
¿Does anyone know a way to sync or script to upload in background without user interacction?
Well i figured out, so i am posting for everyone who needs to run google drive sync app without enter to windows:
create a sheduled task with action start program pointing to: C:\Program Files (x86)\Google\Drive\googledrivesync.exe
add argunment: /autostart
mark execute to run if the user has not logged in
i have also marked execute with higher privileges
the trigger is at system starts with a delay of 30 seconds, it is very important to make a delay!
uncheck the option thats stops the task if it runs for more than x days, this is because google sync is always running in background.
now i have to copy the backups files to google drive folder with and cmd script + sheduled task.
If you are running on a Windows Server 2003 you can try the following to run Drive as a Service:
Download and install Windows Server 2003 resource kit which can be found here
Open a command prompt and run the following:
C:\Program Files (x86)\Windows Resource Kits\Tools>instsrv GoogleDrive "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"
Next is to change the user for witch the newly added service “GoogleDrive” runs under. Change this to Administrator.
Type the following command in the command prompt to open the services snap in console:
services.msc
Choose properties on GoogleDrive service.
Click on tab “Log On”
Click “This account”, and select Admimistrator. Set appropriate password.
Click Apply and OK
Next is to setup some registry settings for the service. Open the registry editor by typing the following command into the command prompt:
regedit
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GoogleDrive
Create a new key “Parameters”
Add a new string value “Application”, (type REG_SZ). Set the value to the path to C:\Program Files (x86)\Google\Drive\googledrivesync.exe /autostart.
Close Registry Editor
Go back to Services, and start the GoogleDrive service
This was adapted from an article about running Dropbox as a service which can be found here.
Essentially the process is to create a Windows service using the 'srvany.exe' which is a Windows service wrapper that will run any program as a service.
Related
I am trying to configure an EC2 Windows 2008 server instance to automatically start a batch file after the instance is restarted (to connect to Jenkins). I have placed a shortcut to the batch file in the Startup folder in the Windows menu.
The problem I am seeing is that the instance does not start the batch file until I actually login to the instance with remote desktop. As soon as I log in to the instance, the file is executed.
How do I make sure that the batch file is started as soon as the operative system is loaded?
I figured it out. The trick was to automatically log in after the instance is restarted:
Open the Start Menu, type netplwiz in the search box, and press Enter.
Untick Users must enter a user name and password to use this computer
Enter the windows password in the confirmation dialogue
The instance will now run the items in the Startup folder in Windows.
If this is not configured on the instance, the login will actually happen when you remote desktop into the instance.
I have the following script which is setup as a task to automatically move a file to a mapped network drive. The problem is that this only works when a user is logged in and has an active Windows session open. However, if the user is logged off these backups wont happen as I believe it cannot find the network drive. This is running on a Windows 2003 Server. Is there anyway to alter the script to make sure it can connect to the networked drive while no active sessions are open?
The process I am using is to move the file, then delete the file to clear up hard-drive space, then a .exe is run to empty the recycling bin.
#echo off
move C:\StarshipBackup\*.* Z:\StarshipDataBackup
del C:\StarshipBackup\*.* /F /Q
C:\emptyrecycle.exe
You can mount the drive in the batch file. Add this before your move command:
net use z: \\yourserver\sharename
Of course, you need to make sure that the account the batch file runs under has permission to access the share. If you are doing this by using a Scheduled Task, you can choose the account by selecting the task, then:
right click Properties
click on General tab change account under
"When running the task, use the following user account:"
That's on Windows 7, it might be slightly different on different versions of Windows.
Running the very nice BGInfo tool to uniquely identify various computers. However, in trying to run on Windows 2008 Server R2, I am getting following error:
"An error occured opening the Default Desktop registry key. Please ensure the current user has rights to change the Logon Desktop settings: Access is denied."
The program is started via a shortcut placed in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup", and that shortcut is specifying a .BGI configuration file (versus reading settings from the Registry). Thoughts on why the error happens for user other than the Administrator?
On a more in-depth level, I am curious if anyone knows why BGInfo must open the "default desktop registry key" and what it is updating in the "logon desktop settings" (phrase in quotes taken from the original error message)?
BGInfo needs to update the registry to set a default login desktop for all RDP users.
You need to run BGInfo with elevated privileges initially. That can be done as described by creed929 or by right-clicking on bginfo.exe and running as administrator. Once the settings are saved, subsequent user logins will not need the elevated privilege to see the BGInfo background.
From an administrator account. I was able to right click on bginfo.exe. Go to Compatibility tab and check the Run this program as an administrator. This seemed to then allow me to apply the settings without the Default Desktop registry key error.
In matlab, I used a windows standalone application. There is a line in this application that writes a file in C:\...\...\. When I run the output exe file produced from this windows standalone application, the exe doesn't write in C:\...\...\ neither tells me that there is a security issues in that partition. All the execution does is nothing. But, when I right-click and run the exe as administrator, it runs correctly.
I want to do it without right-click and run as administrator. Are there is a command in matlab that can do that?
If you create a shortcut to your application, you can go to the Properties of the shortcut, click on Advanced in the Shortcut tab, and select "Run as administrator". That way, whenever you start the application from the shortcut it will be run as an administrator.
(Disclaimer: applications really shouldn't "foul their own nest" by writing into Program Files. This is bad design.)
Starting from Vista, unprivileged processes are not allowed to write to protected folders such as Program Files, because Program Files is designed to store code and not data. However, since this limitation has not been enforced in XP, MS has provided a backward-compatibility hack in the form of Virtual Store. Now, when a program tries to write to protected folder, its output is being redirected into a dedicated folder. This way, the program still "thinks" it writes to its usual location, while in fact it writes to an unprotected location. However, when you later check the Program Files location, you might not see the file - because it's not really there.
You can find more details here: User Account Control Data Redirection.
If you are administrator, add full control permission for your username to the destination folder. You do that by right clicking on the folder, going to properties and then security tab. Then edit and add you username with Full Control rights. Then you don;t have to run the the program as an administrator.
There is no way you can elevate a process once it is started, so Matlab cannot possibly have a command for that. Just running Matlab elevated.
i am using Vista . I designed MSi file through Visual Studio 2008 Setup and deployment project in which I added one custom action. In the custom action, I am opening OpenFile dialog. This Open File dialog is not showing mapped drive or network locations. so how can i make the open file dialog to mapthe network drives.
This is a known problem with Vista User Account Control. When your installation program is started, the non-admin session of the user is elevated to an admin session. The problem is: Network drives mapped in the non-admin session of the user do not automatically carry over to the admin session.
Unfortunately, there is not much you can do about it. (You can start an elevated command prompt prior to starting your setup project and manually net use the drive letters there, but I guess that's not something you can expect your customers to do.)
Related question: Preserve mapped drive letter information during UAC elevation