Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:40:26+00:00 2026-05-27T15:40:26+00:00

I would like to write a python script that would upload any file I

  • 0

I would like to write a python script that would upload any file I select in Windows Explorer. The idea is to select any file in Windows Explorer, right-click to display file’s Context Menu and select a command from there… something like “Upload to Web Server”.

After the command is selected, the Python runs a script which receives the file-path and a file name of the file to be uploaded. The writing the Python script that will upload the file to web seems to be straightforward. What is unclear is how to create an entity in Windows Context Menu for the Python Script. And how to pass the file path and file name to the Python script to catch…. Please advise!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:40:26+00:00Added an answer on May 27, 2026 at 3:40 pm

    Assuming Windows 7, If you open a folder and type “shell:sendto” in the address bar then hit enter you’ll be taken to the context menu. You can add a .cmd file with the following in it.

    @echo off
    cls
    python C:\Your\File\uploadscript.py %1
    

    This should execute your python script passing in the file (%1) as a parameter. Within the python script you can use:

    import sys
    sys.argv  #sys.argv[1] is the file to upload
    

    This gets all parameters passed in so sys.argv[1] should get you the file that was passed in. I tested this and it works. The reason you need the .cmd file instead of going right to the .py is because the .py file wont show up in the Send To menu.

    More information on getting the file passed in is here:
    Accepting File Argument in Python (from Send To context menu)

    EDIT: Adding script for calling on multiple files. Note this calls the python script on each individual file, if you want to send all the files as a parameter to the python script then you’ll need to do a bit more work. You need to research batch scripting if you want to do more advanced things.

    @echo off
    cls
    :upload_loop
    IF "%1"=="" GOTO completed
      python C:\Your\File\uploadscript.py %1
      SHIFT
      GOTO upload_loop
    :completed
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to write a python script that takes a bunch of swf
I would like to write a small notification script using python watchdog for windows.
I would like to write some scripts in python that do some automated changes
In Python, I'd like to write a function that would pretty-print its results to
I would like to write a script that will tell another server to SVN
I would like to write a script to do an heavy network upload, in
I would like to write some data to a file in Ruby. What is
I would like to write a plug-in that will allow a custom written CRM
I would like to write a program that will identify a machine( for licensing
I would like to write a utility that will provide me with a relatively

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.